Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Movember
Starting Member
12 Posts |
Posted - 2009-12-02 : 21:49:29
|
| I have a problem with trying to add up totals of a package that has an upgrade.For example - we have packages, and they can get upgrades. i.e.Package 1 Level 1 $100 - with upgrade - $150Package 1 Level 2 $200 - with upgrade - $275Package 2 Level 1 $300 - with upgrade - $395Package 2 Level 2 $400 - with upgrade - etc...How do I report what is base price and what is upgrade? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Movember
Starting Member
12 Posts |
Posted - 2009-12-02 : 22:12:20
|
| This is the table in question.TransactionIDTransactionDate MemberID OrganisationID SubscriptionID LinkID Title Detail AmountThe way I am separating the upgrades is via the title i.e. sum(CASE WHEN Title like '%upgrade1%' THEN 50 ELSE '0' END) AS Upgrade1,sum(CASE WHEN Title like '%upgrade2%' THEN 50 ELSE '0' END) AS Upgrade2,sum(amount) as 'total'but I need the leftover package total to all sum in one field.Does this make sense? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Movember
Starting Member
12 Posts |
Posted - 2009-12-03 : 00:55:10
|
| Can't change the database design, working of a third party application. |
 |
|
|
|
|
|