By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

query criteria for >today?

P: n/a
I want to query on a date field for any date after today's. I've tried
today and >date, but Access won't accept those. I Googled here, but couldn't find any reference to today's date except in VBA. I hope I don't have to write code in Access to query relative to the current, or any other, date.

Thanks!

Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Use the Date() function in the Criteria row of your query, under your date
field, i.e.:
Date()
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...I want to query on a date field for any date after today's. I've tried
today and >date, but Access won't accept those. I Googled here, but
couldn't find any reference to today's date except in VBA. I hope I don't
have to write code in Access to query relative to the current, or any
other, date.

Thanks!

Nov 13 '05 #2

P: n/a

Allen Browne wrote:
Use the Date() function in the Criteria row of your query, under your date
field, i.e.:
> Date()


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to query on a date field for any date after today's. I've tried
today and >date, but Access won't accept those. I Googled here, but
couldn't find any reference to today's date except in VBA. I hope I don't
have to write code in Access to query relative to the current, or any
other, date.

Thanks!


I tried that, tried it again after reading your reply. When I run the
query, I get an "undefined function date in expression" message. Any
other ideas?

Nov 13 '05 #3

P: n/a

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Allen Browne wrote:
Use the Date() function in the Criteria row of your query, under your date field, i.e.:
> Date()
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to query on a date field for any date after today's. I've tried
>today and >date, but Access won't accept those. I Googled here, but
>couldn't find any reference to today's date except in VBA. I hope I don't>have to write code in Access to query relative to the current, or any
>other, date.
Thanks!


I tried that, tried it again after reading your reply. When I run the
query, I get an "undefined function date in expression" message. Any
other ideas?

Date() is not the same as >date. Be sure you put it on a criteria line by

itself with no quotes around it.

Nov 13 '05 #4

P: n/a
davegb wrote:
I want to query on a date field for any date after today's. I've tried
today and >date, but Access won't accept those. I Googled here, but couldn't find any reference to today's date except in VBA. I hope I don't have to write code in Access to query relative to the current, or any other, date.


Thanks!

If this were a dynamic query that you'd write, it might look something
like this
strSQL = "Select * From YourTableName " & _
Where DateField > #" & Date & "#"

You might want to open a code module and from the menu select the
References item. I have VisBasicForApps as the first item in the list,
the next being the MSAccess library.
Nov 13 '05 #5

P: n/a
On 18 Aug 2005 07:51:34 -0700, davegb wrote:
Allen Browne wrote:
Use the Date() function in the Criteria row of your query, under your date
field, i.e.:
> Date()


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to query on a date field for any date after today's. I've tried
today and >date, but Access won't accept those. I Googled here, but
couldn't find any reference to today's date except in VBA. I hope I don't
have to write code in Access to query relative to the current, or any
other, date.
Thanks!


I tried that, tried it again after reading your reply. When I run the
query, I get an "undefined function date in expression" message. Any
other ideas?


It's >Date() WITH the parenthesis?
If that still gives you the "undefined function ..." message then
check your references for any marked 'Missing'.
Open any code window. Click Tools + References.
Uncheck any marked MISSING.
Exit and try the query again.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #6

P: n/a

fredg wrote:
On 18 Aug 2005 07:51:34 -0700, davegb wrote:
Allen Browne wrote:
Use the Date() function in the Criteria row of your query, under your date
field, i.e.:

> Date()

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"davegb" <da****@safebrowse.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want to query on a date field for any date after today's. I've tried
>today and >date, but Access won't accept those. I Googled here, but
>couldn't find any reference to today's date except in VBA. I hope I don't
>have to write code in Access to query relative to the current, or any
>other, date.
Thanks!


I tried that, tried it again after reading your reply. When I run the
query, I get an "undefined function date in expression" message. Any
other ideas?


It's >Date() WITH the parenthesis?
If that still gives you the "undefined function ..." message then
check your references for any marked 'Missing'.
Open any code window. Click Tools + References.
Uncheck any marked MISSING.
Exit and try the query again.


That did it, Fred! Thanks!

Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.