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
 General SQL Server Forums
 New to SQL Server Programming
 TRANSFORM/PIVOT (Access to SQL) in SQL Server Prog

Author  Topic 

imgajin
Starting Member

5 Posts

Posted - 2010-10-22 : 04:21:33

Hi,
i am using C# + sqlserver 2005 . i have code in Ms access 2000 SQl query
how to convert this ms access code to sql server query . anyone help me.


TRANSFORM Sum(SAIZAN_M.tot) AS caltot
SELECT SAIZAN_M.cuscode, Sum(SAIZAN_M.tot) AS tot1
FROM SAIZAN_M
GROUP BY SAIZAN_M.cuscode
PIVOT IIf([SAIZAN_M.nmonth]>"07","vin",[SAIZAN_M.nmonth]) In ("vin","07","06","05","04","03","02","01","00");

ms access output
================
cuscode tot1 vin 07 06 05 04 03 02 01 00

12345 17894 17894




Sachin.Nand

2937 Posts

Posted - 2010-10-22 : 04:31:03
Look here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=149905

PBUH

Go to Top of Page

michael.appleton
Posting Yak Master

160 Posts

Posted - 2010-10-22 : 04:39:54
You're much better off doing this in the front end using C#. The database should fetch and perhaps process the data, not format it.
Go to Top of Page

imgajin
Starting Member

5 Posts

Posted - 2010-10-22 : 05:38:47
i am really trouble this probs anyone guide me.
Go to Top of Page
   

- Advertisement -