By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Query that groups by month

P: 3
In my database i have a count for each day, but i need to sum the total for each month and the total for the year on one report. THe months must be the columns so i have to use a cross tab query. Because the dates use month, day, year, when i query it will only group the days together, not the months. Is there a way to reformat the dates into month and year only and query off of that by each year? Thanks
Oct 5 '06 #1
Share this Question
Share on Google+
4 Replies


PEB
Expert 100+
P: 1,418
PEB
Yeah,

The way is to use the functions

Year([Yourdate])
Datepart("m",[YourDate])
Datepart("yyyy",[YourDate])

in your query!

Best regards!
Oct 8 '06 #2

P: 3
Is there a way to format Date Part so it displays the month names instead of the month by number? Thanks.

Yeah,

The way is to use the functions

Year([Yourdate])
Datepart("m",[YourDate])
Datepart("yyyy",[YourDate])

in your query!

Best regards!
Oct 9 '06 #3

P: 3
Nevermind, I formatted it and it separated the month by itself. Thanks

Is there a way to format Date Part so it displays the month names instead of the month by number? Thanks.
Oct 10 '06 #4

P: 48
Nevermind, I formatted it and it separated the month by itself. Thanks
The Datepart function does not recognize monthnames, the function Format does; Format([YourDate];"mmmm")..
Oct 10 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.