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

monthly and yearly report?

Status
Not open for further replies.

athos07

Programmer
Aug 1, 2002
19
AU
i have a very simple problem, but since im new to this i dont know what to put in my sql code..

i have a table called [masterlist]

biddate itbnumber ac
02/02/2001 ITB2-011-04 ov-10
08/28/2001 ITB2-011-04 uh-1h
12/10/2001 ITB2-039-06 f-27
01/10/2002 ITB2-039-06 uh-1h
01/13/2002 ITB2-039-06 uh-1h
01/15/2002 ITB2-039-06 ov-10

i want to have have the monthly and a seperate yearly report for this. when requested for a monthly or yearly report.
 
Hi,

MONTHLY
-------
SELECT Format([biddate],"mm-yyyy") AS MONTH, masterlist.itbnumber, masterlist.[ac]
FROM masterlist
GROUP BY Format([biddate],"mm-yyyy"), masterlist.itbnumber, masterlist.[ac];

YEARLY
-------
SELECT Format([biddate],"yyyy") AS Years, masterlist.itbnumber, masterlist.[ac]
FROM masterlist
GROUP BY Format([biddate],"yyyy"), masterlist.itbnumber, masterlist.[ac];

You can add in your counts/avg/min/max etc to these queries.

Hope this helps

B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top