query on a field that has =now() as data (1 Viewer)

Martix

Registered User.
Local time
Today, 20:05
Joined
Jul 24, 2001
Messages
22
I wrote a dispatch form for the databse im working on for the security company i work for. When the open form button is pressed it opens the form, goes to new record, and stamps current date and time using the "=now()" operator as the default value for the time/date field. I cant seem to get a query to work on this field unless i query for the entire fields data, Meaning if i need to pull every record form a specific date it will not allow me to use "like" or something like this "7/14/01*" in the prompted info box that is set as the citeris for the query in that field ( meaning in the time/date field in the query my criteria looks like this "[please enter reporting date]". any way around this for either the date part of the field or the time part of the field
 
R

Rich

Guest
I don't fully understand your question but if your entering the date in an input box it should be 7/14/01 if your in the criteria cell of your query it's #7/14/01# don't use like for dates.
HTH
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:05
Joined
Feb 19, 2002
Messages
43,484
You can use the Format() function to extract just the date portion.
Select ...
From YourTable
Where Format(YourDate,"mm/dd/yyyy") = [enter mm/dd/yyyy];
 

Martix

Registered User.
Local time
Today, 20:05
Joined
Jul 24, 2001
Messages
22
thank you ill try the format function
 

Users who are viewing this thread

Top Bottom