Converting Date/Time

  • Thread starter Thread starter greenface via AccessMonster.com
  • Start date Start date
G

greenface via AccessMonster.com

I need to convert date field to Month / Year to allow me to query by month.
For example converting 01/01/2005 to Jan 05. Is there a simple way of doing
this in the query?
 
Format([DateField], "mmm yy")

should do.

However, this may not be the most effcient way of selecting Records by month
since you are comparing Strings rather than numeric value. The more
efficient method would be:

[DateField] >= DateSerial([RequiredYear], [RequiredMonth], 1) AND
[DateField] < DateSerial([RequiredYear], [RequiredMonth] + 1, 1)
 
Back
Top