A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date query using Date()



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2005, 04:36 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave
  #2  
Old December 22nd, 2005, 04:43 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

Is your Deadline field a Date/Time field or a Text field?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conrad...essjunkie.html



"David M C" wrote in message
...
I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to
filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave



  #3  
Old December 22nd, 2005, 04:45 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

Try =Now()

"David M C" wrote:

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave

  #4  
Old December 22nd, 2005, 04:50 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

If you enter the date directly in the query, are any records returned?

Field: Deadline
Criteria: #12/22/2005#

If that fails to return records then your Deadline field probably contains a
time component as well as the date. So try using a range

Field: Deadline
Criteria: =#12/22/2005# and #12/23/2005#

If that fails - are there other criteria in the query that would cause no
records to be returned for the date?


"David M C" wrote in message
...
I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to
filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave



  #5  
Old December 22nd, 2005, 05:52 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

On Thu, 22 Dec 2005 08:36:03 -0800, David M C wrote:

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave


My guess is that your date field includes a time value.
12/22/2005 is not equal to 12/22/2005 09:15 AM.

If so, your criteria should be
Where [Deadline] =Date() And Date()+1
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #6  
Old December 23rd, 2005, 08:54 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

Deadline format is Date/Time. How would I change it to be Date only? When
entering new records, if you only input a Date, what does Access do with the
Time part?

Thanks

Dave

"fredg" wrote:

On Thu, 22 Dec 2005 08:36:03 -0800, David M C wrote:

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave


My guess is that your date field includes a time value.
12/22/2005 is not equal to 12/22/2005 09:15 AM.

If so, your criteria should be
Where [Deadline] =Date() And Date()+1
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #7  
Old December 23rd, 2005, 12:34 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

Access doesn't have a Date only (nor a Time only) data type, just the
Date/Time data type.

Under the covers, the date/time is stored as an 8 byte floating point
number, where the integer portion represents the date as the number of days
relative to 30 Dec, 1899, and the decimal portion represents the time as a
fraction of a day. If you don't supply a time, Access assumes midnight at
the start of the day.

How are you populating the Deadline field? If you're using the Now()
function, change it to Date().

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"David M C" wrote in message
...
Deadline format is Date/Time. How would I change it to be Date only? When
entering new records, if you only input a Date, what does Access do with
the
Time part?

Thanks

Dave

"fredg" wrote:

On Thu, 22 Dec 2005 08:36:03 -0800, David M C wrote:

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to
filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave


My guess is that your date field includes a time value.
12/22/2005 is not equal to 12/22/2005 09:15 AM.

If so, your criteria should be
Where [Deadline] =Date() And Date()+1
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail



  #8  
Old December 23rd, 2005, 02:13 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date query using Date()

Deadline is populated manually through a form. The user inputting the latest
job enters the date it must be finished by.

I think I'll have to use the suggestion in one of the replies above.

"Douglas J. Steele" wrote:

Access doesn't have a Date only (nor a Time only) data type, just the
Date/Time data type.

Under the covers, the date/time is stored as an 8 byte floating point
number, where the integer portion represents the date as the number of days
relative to 30 Dec, 1899, and the decimal portion represents the time as a
fraction of a day. If you don't supply a time, Access assumes midnight at
the start of the day.

How are you populating the Deadline field? If you're using the Now()
function, change it to Date().

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"David M C" wrote in message
...
Deadline format is Date/Time. How would I change it to be Date only? When
entering new records, if you only input a Date, what does Access do with
the
Time part?

Thanks

Dave

"fredg" wrote:

On Thu, 22 Dec 2005 08:36:03 -0800, David M C wrote:

I've been using Date() to filter for various records (Completed After
Deadline Date, Before Deadline Date etc.). However, I cannot get it to
filter
for records with "Deadline" = current date.

In the query criteria field for "Deadline" I put:

=Date()

but no records are displayed, even though I have ensured there is a
"Deadline" field with todays date stored in it.

Ideas?

Thanks

Dave

My guess is that your date field includes a time value.
12/22/2005 is not equal to 12/22/2005 09:15 AM.

If so, your criteria should be
Where [Deadline] =Date() And Date()+1
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Average cutthroatjess Running & Setting Up Queries 17 December 19th, 2005 07:52 PM
Reports with Date Range - Errors jwr Setting Up & Running Reports 12 August 8th, 2005 12:57 PM
Query for 'confirmation' rogge Running & Setting Up Queries 8 April 19th, 2005 03:26 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Print Taher Setting Up & Running Reports 1 August 31st, 2004 09:07 PM


All times are GMT +1. The time now is 06:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.