T-Sql Remove decimal point from Money Data Type.
DECLARE @mon1 MONEY, @mon2 MONEY, @mon3 MONEY, @mon4 MONEY, @num1 DECIMAL(19,4), @num2 DECIMAL(19,4), @num3 DECIMAL(19,4), @num4 DECIMAL(19,4) SELECT @mon1 = 100, @mon2 = 339, @mon3 = 10000, @num1 = 100, @num2 = 339, @num3 = 10000 SET @mon4 = @mon1/@mon2*@mon3 SET @num4 = @num1/@num2*@num3 SELECT @mon4 AS moneyresult, @num4 AS numericresult
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 2.5
- What is a change to SQL Server tables?
- How do I upgrade my SQL Server database version?
- What is the best implementation of MySQL for SQL Server 2005?
- The ability to edit a database by multiple users is essential.
- How do you copy a data base?
- How do I unit test persistence?
- Convert HashBytes to VarChart?
- How do I divide a string so I can access item x?
- How do you get the data from a temporary table in SQL Server?
- How do I use T-SQL group?
- How much disk space does a SQL Server table currently use?
- Can you remove the time portion of a datetime value?
- What do you need to do for XML files?
- Paging SQL Server 2005 Results. What are some examples of this?
- How do you get leading wildcard full-text searches in SQL Server?