Converting Date/Time

  • Thread starter greenface via AccessMonster.com
  • 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?
 
V

Van T. Dinh

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)
 
Top