Jump to content

Please help - Access SQL date format problem...


Recommended Posts

Im a noob at SQL and Microsoft Access. Only been using online tutorials for past week.

I am using DD-MM-YYYY instead of the american MM-DD-YYYY format in my data base.

What im trying to do is to write a query to only display individuals in my data base that are aged 20-25 on a specified date (6/6/2002)

athletetableyh1.jpg

sqlquerygg6.jpg

'Data type mismatch in criteria expression' is the error i keep getting and i dont understand why.

Is it that the query would only work when the date format is in MM-DD-YYYY? I already set the 'dOB' field to date/time format and it has accepted the DD-MM-YYYY format so i doubt it.

Can anyone help?

Link to comment
Share on other sites

  • 1 month later...

The correct criteria expression for dates is:

Between #06/06/1977# And #06/06/1982#

BTW, all date/time formats are readable by MS Access,

no matter how they look, as long as they are correct formats.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...