YYYYMMDD question

  • Thread starter bluefalcon904 via AccessMonster.com
  • Start date
B

bluefalcon904 via AccessMonster.com

Hi..

I have a table with a date field in mm-dd-yyyy format. How do I make a query
that when I enter date in YYYYMMDD format would search in the date field even
though its in mm-dd-yyyy format.

Appreciate the help.

thank you.
 
K

Klatuu

You will need to convert the entry to a date format. If you are entering the
YYYYMMDD in text box on a form and calling the query from the form using the
value of the text box as a date criteria:

DateSerial(Left([forms!MyForm!MyDate, 4), Mid([forms!MyForm!MyDate, 5,2),
Right([forms!MyForm!MyDate, 2))
 
B

bluefalcon904 via AccessMonster.com

Hi...

How can I do it in Select format? sorry.. im just a newbie.
thanks


You will need to convert the entry to a date format. If you are entering the
YYYYMMDD in text box on a form and calling the query from the form using the
value of the text box as a date criteria:

DateSerial(Left([forms!MyForm!MyDate, 4), Mid([forms!MyForm!MyDate, 5,2),
Right([forms!MyForm!MyDate, 2))
[quoted text clipped - 5 lines]
thank you.
 
D

Douglas J. Steele

Try using the following for your criteria:

=CDate(Format([When?],"0000\-00\-00"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top