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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group by month!?

Status
Not open for further replies.

kingz2000

Programmer
May 28, 2002
304
DE
In oracle, I f I want a grouping by months this SQL works:

SELECT TO_CHAR(datum, 'Month') Month, sum(x) number
FROM table_A
where datum between '1.1.2005' and '31.3.2005'
GROUP BY to_char(datum, 'Month')

result:
january 45
february 60
march 33

How do I do the same for Access? Access doesn't seem to understand to_char, for example.
Thanks in advance.
Kingsley
 
Use Month(datum) to get the month number (1..12) or format(datum,"mmmm") to get the month name in full.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top