microsoft Query with Excel

K

Karen

I'm trying out some stuff and need help with MS Query with Excel.

My company will be using SQL databases after a major upgrade to our business
system. One of the things I hope to do is query an SQL file and select
records where the date field is greater than todays date minus six
(ardisfil.ar_dist_dt > date()-6). My problem is I don't see a date()
function!

Any ideas for me?

Karen
 
K

Karen

in Microsoft Query there doesn't seem to be a Now() function either.

I don't want to do the parameter in the worksheet. It needs to be done in
the Query itself.

K-
 
J

Jamie Collins

=Now()-6 should work

AFAIK, Now() will only work when the data source and provider in
question are MS Jet.

The ANSI standard, which in Jet does not implement, is

SELECT CURRENT_TIMESTAMP

The (mis)use of the term 'SQL database' often implies a MS SQL Server
database, for which the ANSI standard will work, as will the
proprietary (but widespread GetDate() function.

Jamie.

--
 
Top