Access Query on Date/Time not allowing criteria

I am writing a query in MS-Access using a SQL linked data table.  The field, ServiceDateTime is a Date/Time format.  When I look at the data it comes across as 9/20/13 8:52:00 AM.

When I enter the criteria =#9/20/13# I get no data returned.

How can transform the data to allow date criteria?

Thanks

Glen
GPSPOWAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chaauCommented:
The data in your table has a time component. So, you can't just compare it with date only. You need to truncate the time value from the data. The simplest way to do so is to use Date() function, like this:

In the field write this expression:
DateOnly: Date([YourTable].[yourColumn])
In the criteria write your criteria:
=#9/20/13#
0
Rey Obrero (Capricorn1)Commented:
try  this criteria

where datevalue([ServiceDateTime])=#9/20/2013#
0
GPSPOWAuthor Commented:
Neither solution worked.

The first said I had the wrong amount of arguments

The second said data type mismatch

Glen
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Rey Obrero (Capricorn1)Commented:
try this one

where format([ServiceDateTime],"yyyymmdd")="20130920"

or

where format([ServiceDateTime],"yyyymmdd")='20130920'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GPSPOWAuthor Commented:
That worked.

Thanks

Glen
0
GPSPOWAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.