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!

SELECT WITH DIFFERENT MONTHS AND DIFFERENT CLIENTS

Status
Not open for further replies.

jorg32

Programmer
Jul 10, 2003
57
BE
Hi,

How do I have to make a list of clients including sum/month/client?

Example :

Client A : Client B : Client C :
01/04 = 340.50 € 01/04 = 1,520.36 € ...
02/04 = 352.68 € 02/04 = 250.36 € ...
03/04 = 25.59 € 03/04 = 1,985.32 € ...
... ...
... ...

Is this easy or do I have to use TempDatabases?

Thanks for helping me!!
Jorg
 
What is the structure of your table?

You could do something like

Code:
SELECT Client, Datepart(mm,DateOfSale), sum(sales)
FROM MySalesTable
WHERE DatePart(yy, DateOfSale) = 04 --ensures only for current year
GROUP By Client, Datepart(mm, DateOfSale)

It will give you the base data as required, and then you could then format it as you please in the front end.


"I'm living so far beyond my income that we may almost be said to be living apart
 
I have to use 2 tables:

1) with all the info about the client + his orders/date
and
2) with alle the articles + prices of this orders.

The only link is the Ordernumber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top