Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT
CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1)
FROM
TABLE_NAME
BOL said:Using CONVERT:
CONVERT
(
data_type ( length ),
expression ,
style
)
Arguments
Expression;
Is any valid Microsoft® SQL Server™ expression. For more information, see Expressions.
Data_Type;
Is the target system-supplied data type, including bigint and sql_variant. User-defined data types cannot be used. For more information about available data types, see Data Types.
Length;
Is an optional parameter of nchar, nvarchar, char, varchar, binary, or varbinary data types.
Style;
Is the style of date format used to convert datetime or smalldatetime data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data types), or the string format when converting float, real, money, or smallmoney data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data types).
Money/SmallMoney Styles;
0 (default)
No commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 4235.98
1
Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92
2
No commas every three digits to the left of the decimal point, and four digits to the right of the decimal point; for example, 4235.9819
Select Replace(Convert(VarChar(100), Convert(Money, 750000, 0),1), '.00', '')
SELECT
LEFT(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1), LEN(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1))-3)
FROM
TABLE_NAME
SELECT
Budget = CASE dbo.FUNCTION_NAME(FIELD_NAME)
WHEN dbo.FUNCTION_NAME(FIELD_NAME) = '0' THEN 'Yes'
ELSE dbo.FUNCTION_NAME(FIELD_NAME)
END,
FROM TABLE_NAME
SELECT
Budget = CASE LEFT(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1), LEN(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1))-3)
WHEN LEFT(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1), LEN(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1))-3) = '0' THEN 'Yes'
ELSE LEFT(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1), LEN(CONVERT(VARCHAR, CONVERT(MONEY, ISNULL(FIELD_NAME, 0)), 1))-3)
END,
FROM TABLE_NAME