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 2000 Forums
 Transact-SQL (2000)
 how to format SS with dash

Author  Topic 

cjcclee
Starting Member

33 Posts

Posted - 2007-12-19 : 10:54:00
SS in database is no dash, I create crystal report using store procedure. I want the SS on crystal report with dashes. I try to format SS in the select statement, I do not know how to do it.
123456789, I want it to be 123-45-6789 in the select statement.Thanks!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-19 : 10:57:32
use the format property for CR to do this.
or in SQL Server, STUFF(STUFF(SSN, 5, 0, '-'), 3, 0, '-')



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-12-19 : 11:02:34
Always, always, always, always do simple formatting like this in Crystal Reports. Just create a formula like

left(ss,3) + '-' + mid(ss,4,2) + right(ss,4)

.. or something like that (I forget the specific string functions and parameters that crystal uses).

If you aren't sure how to create basic fomulas like this in Crystal, you really should learn, it is very fundamental to using the product.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -