Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying date field in Access database?

Status
Not open for further replies.

lowtide

Programmer
May 17, 1999
24
US
I need to query an Access db for all of<br>the rows that match a specific month and year only<br>in a smalldate field. What is the best way<br>to format the WHERE clause of the sql statement?<br>I would like to use the moth as a 2 digit number<br>and year as a 4 digit number.<br><br>I have tried &quot;WHERE datefield like 'mo%year%'&quot;<br>But it does not work.<br><br>Thanks<br>Lowtide
 
It's been a long time since I did anything with Access,&nbsp;&nbsp;but I seem to remember that dates needed to be delimited by #<br> <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Format function of Access will work on this one. <br>expr1: format(yourdatefield, &quot;mm&quot;)<br>In the criteria enter the month you're querying. 1 for Jan, 2 for Feb, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top