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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select in a view for more result

Author  Topic 

lamineba
Starting Member

2 Posts

Posted - 2013-03-23 : 08:48:57
hy !
There is my view
mvtDtate mvtMouvementDebCred TypemvtMouvementDebCred
1/1/2013 154 000 D
2/1/2013 210 000 C
3/1/2013 654 012 D
4/1/2013 213 000 564 C
After more essay : And I want a result as this :
mvtDtate mvtMDebCred mvtMDeb mvtMCred TypemvtMDebCred
1/1/2013 154 000 154 000 ----------- D
2/1/2013 210 000 ----------- 210 000 C
3/1/2013 654 012 654 012 ---------- D
4/1/2013 213 000 ----------- 213 000 564 C
thanks ........

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-03-23 : 17:17:19
[code]SELECT
mvtDtate,
mvtMouvementDebCred,
CASE WHEN TypemvtMouvementDebCred = 'D' THEN mvtMouvementDebCred END AS mvtMDeb,
CASE WHEN TypemvtMouvementDebCred = 'C' THEN mvtMouvementDebCred END AS mvtMCred,
TypemvtMouvementDebCred
FROM
YourOriginalViewOrTable;[/code]
Go to Top of Page

lamineba
Starting Member

2 Posts

Posted - 2013-03-25 : 11:46:26
hy
thanks James , my problems is resolved
Go to Top of Page
   

- Advertisement -