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.

 All Forums
 Development Tools
 ASP.NET
 Cross tab output

Author  Topic 

Swati Jain
Posting Yak Master

139 Posts

Posted - 2007-10-09 : 03:05:20
Hello All,

I want to generate Cross tab sql query output with following info
1)select @AssetID =----> this value will be selected from tlb
2)select fixedAssets from tlb1 where AssetID=@AssetID
3)select cost from tlb2 where fixedAssets ----> fixed asset selected in above query
This query will be executed in cursor for every record in tlb

Now queries output wil be like
Fixed Asset1 Fixed Fixed Asset2 ...........FixedAsset..n (till nth row in tlb2)
Cost
Date1
.... ....
Date2
-------------------------------------------------------------------------------------------------------------------------------------
Total Cost- Cost1 Cost2 .............................................Costn =Sum(Cost1+Cost2......Costn)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-09 : 03:09:57
Maybe you should concentrate on finishing previous tasks first?
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=90653



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-10 : 02:36:59
quote:
Originally posted by Peso

Maybe you should concentrate on finishing previous tasks first?
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=90653



E 12°55'05.25"
N 56°04'39.16"



It is really sad that Swati Jain doesnt follow up her threads usually. There are lot of such threads

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -