Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using datetime with EQUALS currentdate

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
I would like to simply find records with a datetime field = currentdate. Because it's a datetime, it will only find a match if the time and seconds match. How do I just look at the date portion and compare to currentdate?
 
Actually this should work without converting it to a date--you should test that to make sure using your database. It works for me.

Otherwise you would just use:

date({table.datetime}) = currentdate

-LB

 
Sorry I entered the syntax from the crystal report I was working on. In SQL, the syntax is; select * from table where createdate=getdate()

This does not work even though I see records with a create date of today.
 
Are you using a command then? What type of database?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top