June 1, 2015 at 10:19 pm
Comments posted to this topic are about the item Pounds of Formatting Fun
June 2, 2015 at 12:50 am
Nice question, I don`t remember I had the need to use FORMAT before, thanx.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
June 2, 2015 at 7:17 am
This was removed by the editor as SPAM
June 2, 2015 at 7:32 am
Interesting question, thanks Andy. 🙂
June 2, 2015 at 10:16 am
🙂 Thanks, Andy!
June 2, 2015 at 11:05 am
I think it makes perfect sense to have FORMAT function work on numeric values from right to left. Consider the following:
SELECT FORMAT(1234,'###,###,###')
June 2, 2015 at 11:43 am
To my understanding SQL Server may not need much use of FORMAT as if I want that users need to enter mobile no based on US style i.e. 3-3-4, then those kind of check can be done in the application side itself. No?
But yes, its a good question. Outcome of the question was slightly unpredictable to me. but I scored 2 marks. 🙂
Thanks.
June 2, 2015 at 11:47 am
Chris, you might be right on that. It just wasn't what I was expecting, right or wrong!
June 2, 2015 at 1:58 pm
Nice question but an easy one.
When I installed my SQL Server 2012 Express , I have discovered this way to format a number in the BOL and I have tested it ( and dug in my memory ) , so I have had only to dig it up.
It is important to remember what it is difficult to use it remotely ( CLR... ) what is written in the BOL
"This function will not be remoted since it depends on the presence of the CLR. Remoting a function that requires the CLR would cause an error on the remote server."
Useful feature but with some limit...
June 3, 2015 at 1:59 am
With ZEROS:
SELECT FORMAT(12354,'000-00-0000') AS 'SSN'
Returns "000-01-2354"
June 3, 2015 at 5:06 am
I found this to be very interesting because it got me thinking of the age-old argument of formatting the data in the database versus on the client-side. There are times when you just want it formatted on the database side of the world and this is a useful function to have in the toolbox. Thanks.
June 3, 2015 at 5:44 am
Ed Wagner (6/3/2015)
I found this to be very interesting because it got me thinking of the age-old argument of formatting the data in the database versus on the client-side. There are times when you just want it formatted on the database side of the world and this is a useful function to have in the toolbox. Thanks.
+1 .
You have succeeded to write in an understandable English language what I was thinking.
June 3, 2015 at 6:21 am
Nice straightforward question. Don't know why it should be two points, though. 🙂
Of course the second reference in the explanation is a lovely illustration of the sheer awfulness of some of Microsoft's .NET documentation :sick: - maybe that's why?
Tom
June 4, 2015 at 12:28 am
Very interesting question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 4, 2015 at 8:15 am
It was just what I expected.
So there was no fly in the ointment.
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply