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 2012 Forums
 Transact-SQL (2012)
 COLUMN RIGHT JUSTTIFY

Author  Topic 

langthanh
Starting Member

4 Posts

Posted - 2014-01-27 : 20:29:56
Hi eveyone

i have a table like this
Name Ag Bi
Name1 1.2 1.5
Name2 2.2 2.5
Name3 3.2 3.5
Name4 4.2 4.5
Name5 5.2 5.5

and i need to out put the result like this : (right justify the Ag and Bi columns )

Name Ag Bi
Name1 1.2 1.5
Name2 2.2 2.5
Name3 3.2 3.5
Name4 4.2 4.5
Name5 5.2 5.5

does anyone know how to do this

thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-01-27 : 22:30:48
Do this in your client application. Not in the SQL Server


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-28 : 03:16:38
quote:
Originally posted by langthanh

Hi eveyone

i have a table like this
Name Ag Bi
Name1 1.2 1.5
Name2 2.2 2.5
Name3 3.2 3.5
Name4 4.2 4.5
Name5 5.2 5.5

and i need to out put the result like this : (right justify the Ag and Bi columns )

Name Ag Bi
Name1 1.2 1.5
Name2 2.2 2.5
Name3 3.2 3.5
Name4 4.2 4.5
Name5 5.2 5.5

does anyone know how to do this

thanks




this is a presentation issue and should be done at your front end application.


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

langthanh
Starting Member

4 Posts

Posted - 2014-01-28 : 11:24:22
the problem is because i create a report in code behind using the rdl definition file and i do not know much how to change the report layout in code so i have to change it from my sql query

thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-29 : 04:18:26
quote:
Originally posted by langthanh

the problem is because i create a report in code behind using the rdl definition file and i do not know much how to change the report layout in code so i have to change it from my sql query

thanks


Nope
its very easy to do this in rdl
just select the textboxes where you want to justify and click on right justify button available on top menu and you'll get data right justified.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -