PDA

Click to See Complete Forum and Search --> : FORMAT function in SQL Server 7 - HELP!!!


Jimbob
Jun 30th, 2000, 10:55 AM
What's the equivalent of the FORMAT function in SQL Server 7.

I'm converting an older app from DAO, and sometimes comes up with a query that includes the following: -

Format(ROUND(([GrossPrice]+[Tax]-((([GrossPrice]+[Tax])/100)*[Commission])),2),'0.00') AS Net

but SQL Server doesn't like FORMAT...

Mongo
Jun 30th, 2000, 12:12 PM
In Sybase you'd use:

convert(money, ([GrossPrice] + [Tax] - ([GrossPrice]+[Tax]) / 100) * [Commission])) AS Net

But check your MS SQL Server refs for the specifics on the CONVERT function.





[Edited by Mongo on 07-01-2000 at 01:17 AM]

Jun 30th, 2000, 03:54 PM
In SQL Server(6.5 or 7.0) you could use CONVERT or CAST.