View Full Version : Need to extract month from a date


chubbychap
04-22-2008, 07:35 AM
Hi - I need to extract the month from a date via an SQL pass through query. e.g. if the date reads 19/02/2008, I need to have returned to me 'FEB', so that I can link the month (string) to another table.

I have though about "decoding" the date - I've seen that practice used in other scenarios, but never on a date format. Any suggestions?
Thanks

ByteMyzer
04-22-2008, 07:49 AM
Try something like:

SELECT Format(MyTable.DateField, 'mmm') As MonthOfDateField
FROM MyTable;