|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need help with Month / Year QueryI have a table with order dates for the past few years. I am trying to
write a query that just ives me a distinct month/year for all the orders so that I can do my reports monthly. I have been wracking my brains over this one for the past few days and just can't seem to get it. Basically what I need is a way to get a distinct month/year from OrderDate. Thanks for the help in advance "Gomi" <wy***@wyattf.com> wrote in message select year(dateOrder), month(dateOrder)news:1135267024.962663.204530@g43g2000cwa.googlegroups.com... >I have a table with order dates for the past few years. I am trying to > write a query that just ives me a distinct month/year for all the > orders so that I can do my reports monthly. I have been wracking my > brains over this one for the past few days and just can't seem to get > it. > > Basically what I need is a way to get a distinct month/year from > OrderDate. > > Thanks for the help in advance from orders group by year(dateOrder), month(dateOrder) order by year(dateOrder), month(dateOrder) OR select distinct year(dateOrder), month(dateOrder) from orders order by year(dateOrder), month(dateOrder) I cannot believe it was that simple. Thank you. I blame it all on me
looking forward to a week off for the holidays Happy holidays then.....
Show quote "Gomi" <wy***@wyattf.com> wrote in message news:1135267975.117003.281660@g14g2000cwa.googlegroups.com... >I cannot believe it was that simple. Thank you. I blame it all on me > looking forward to a week off for the holidays > |
|||||||||||||||||||||||