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!

Query Help - Quarterly Sums 3

Status
Not open for further replies.

AnonGod

IS-IT--Management
Jun 5, 2000
223
Hello again - :)

This might be a vba only query, but any input is appreciated.

Table 'Main':
Code:
[b][u]Date      Contract  TotalTrans Profit    [/u][/b]
9/28/2005 11/1/2005 111       $12.34
9/29/2005 11/1/2005 222       $56.78
9/30/2005 11/1/2005 333       $90.12
10/3/2005 11/1/2005 999       $98.76
10/4/2005 11/1/2005 888       $54.32
10/5/2005 11/1/2005 777       $10.98

Wanted Output:
Code:
[b][u]Quarter   Days      SumTrans  SumProfit [/u][/b]
3rd, 2005 3         555       $159.24
4th, 2005 3         2664      $164.06
Whatever can be put in the Quarter field is fine - just need to identify what quarter it's in.
Note September (9/x/2005) is in the 3rd quarter of the year and October (10/x/2005) is in the 4th quarter of the year.

Thanks again for any help.
:) -Andrew

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
SELECT Format([Date], 'q, yyyy') As Quarter, Count(*) As Days, Sum(TotalTrans) As SumTrans, Sum(Profit) As SumProfit
FROM Main
GROUP BY Format([Date], 'q, yyyy')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Excellent - Thank you. Works like a charm.

I didn't know 'q' was available.

Thanks
:) -Andrew

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top