SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Select in a view for more result
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lamineba
Starting Member

2 Posts

Posted - 03/23/2013 :  08:48:57  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3712 Posts

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

lamineba
Starting Member

2 Posts

Posted - 03/25/2013 :  11:46:26  Show Profile  Reply with Quote
hy
thanks James , my problems is resolved
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000