Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-06
4
Medium Priority
?
221 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:QMBB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 36492312
try this query

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

or this

select * from table
where datevalue([dateField])= Date()
0
 

Author Comment

by:QMBB
ID: 36492347
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36492365
select * from table
where datevalue([dateField])= Date()
order by [dateField]
0
 

Author Comment

by:QMBB
ID: 36492426
Beautiful, thanks again very much.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question