Query Help

strider

Well-known member
Joined
Sep 20, 2004
Messages
52
Location
Dublin, Ireland
Programming Experience
1-3
Hey there... im have a query im not sure how to do


i have 3 tables, Customers, Contracts and Jobs

Customer - iId, sName

Contracts - iId, iCustId, mCleaningCost, mWashCost, mServiceCost

Jobs - iId, dJobDate, iCustId, bCleaning, bWash, bService

i means integer type, m means smallmoney type and b means boolean type

so basically a customer has a contract type which contains the costs of services provided.
the services that are provided to the customer when they come in are marked in the job table as boolean (yes/no)


so what i need to do is a report that reports the cost associated with the customer.Something like

Date Customer Cleaning Wash Service Total
01/01/2007 abc 20.00 25.00 40.00 85.00
15/01/2007 abc 0.00 0.00 40.00 40.00
20/01/2007 abc 20.00 25.00 00.00 45.00

but im not sure how to do this in SQL
 
Back
Top