I want to get the month part from a Date field in my query so i established my query like,
SELECT DatePart('m', Trans_Date) AS TransMonth FROM tblTransactions
The result will give me TransMonth=4 for April and so on... Further, instead of returning an integer value, i want to get the month name itselt, say "April", so i used the Format function like,
SELECT Format(DatePart('m', Trans_Date), 'mmmm') AS TransMonth FROM tblTransactions
However, the result always returned with the value TransMonth="January" even though Trans_Date='04/30/03' OR Trans_Date='any_other_date'.
How do i fix this problem? If you could give me a better method for the purpose, pls let me know.
Thanks in advance,
SELECT DatePart('m', Trans_Date) AS TransMonth FROM tblTransactions
The result will give me TransMonth=4 for April and so on... Further, instead of returning an integer value, i want to get the month name itselt, say "April", so i used the Format function like,
SELECT Format(DatePart('m', Trans_Date), 'mmmm') AS TransMonth FROM tblTransactions
However, the result always returned with the value TransMonth="January" even though Trans_Date='04/30/03' OR Trans_Date='any_other_date'.
How do i fix this problem? If you could give me a better method for the purpose, pls let me know.
Thanks in advance,