Problem solve Get help with specific problems with your technologies, process and projects.

'Format' in SQL Server

I am trying to build an application, which will work on MS Access and SQL Server. I have some queries written by someone using the Visual Basic "FORMAT" function. I didn't find anything that will be compatible with "Format" in SQL Server. "Cast/Convert" can't solve this issue.

Sample Statements:

 Select Format(Amt, "###,##.##") as Amount from Table A Select "Balance: " & Format(Amt, "###,##.##") as Amount from Table A
Any advice other than to change the current statements?

You are trying to do 2 diametrically opposite things. The format commands are for data display. SQL Server is a storage engine and does absolutely nothing with formatting nor does it have any capability to format for an application. Formatting is done in SQL Server at the application side and does not involve the database engine. There are no equivalents or translations for that kind of thing.


For More Information

This was last published in January 2004

Dig Deeper on Storage Networks

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.