Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Sep 13, 1999

Displaying Retrieved Text in a Certain Manner

Question:
When char data is retrieved, is there a way to display it in a certain way? An example would be a phone number. If the phone number data is nothing but a string of numbers, is there a way to tell the query to output it as 123-456-7890 instead of 1234567890?

Answer:
Yes you can. Two things come to mind: one is to create a rule on the column that enforces the pattern you want; the other is to give the illusion of those marks by planting them in your SQL statement so that the result comes back with the embedded dashes, etc.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap