Access 2003 query, return todays date from date/time field

Date() doesn't seem to work with a date/time field, because it returns zero records even though there are records from today. How do I work around that?
QMBBAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
try this query

select * from table
where [dateField] between Date() and Date()+1

or this

select * from table
where datevalue([dateField])= Date()
0
 
QMBBAuthor Commented:
That second one works perfectly, thanks very much. One last question related to that.... is there a way to sort the results of that date/time field? In the datasheet view it can be sorted, but in the form which displays the results, it just displays them random, even if I set the query properties to ascending on that field.
0
 
Rey Obrero (Capricorn1)Commented:
select * from table
where datevalue([dateField])= Date()
order by [dateField]
0
 
QMBBAuthor Commented:
Beautiful, thanks again very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.