Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 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

3873 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  
 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.08 seconds. Powered By: Snitz Forums 2000