|
-
May 15th, 2007, 05:06 AM
#1
Thread Starter
Fanatic Member
Querying Help
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
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|