Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Conversion
Message
 
 
To
30/09/2011 13:19:23
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01525186
Message ID:
01525370
Views:
41
Don,

If you want help in SQL, please post DDL of your table(s), some input and desired output. In the meantime, this blog post may be of help
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/understanding-sql-server-2000-pivot


>You win! I hadn't thought about putting the SUM in front of the whole thing. Now here's another part of the puzzle. My select currently includes creation of an empty field like this.
CAST(0 AS numeric(12,2)) as julPrior,
Which is then followed by
update TempRevenues set julPrior = (select amount from [RTA-Revenues] where category = TempRevenues.CATEGORY and MONTH(receiveddate)=7 and fisyear = TempRevenues.FISYEAR - 1 )
to populate it. Can you think of a way to do this in 1 step instead of 2? I suppose the CASE could be worked into that second line as well but what I'd really like to do is eliminate that second line.
>
>
>
>>Realy?
>>
>>SUM(CASE WHEN month([receiveddate])=7 THEN [AMOUNT] ELSE 0.00 END) as Jul
>>
>>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform