First, CAST as VARCHAR:
LTRIM(RTRIM(CAST(CAST('2.50823E+12' AS FLOAT) AS NVARCHAR)))
Second, CAST as MONEY:
LTRIM(RTRIM(CAST(CAST(CAST('2.50823E+12' AS FLOAT) AS NVARCHAR)AS MONEY)))
Now, let's see this in a CASE statement:
,CASE
WHEN [AMOUNT] LIKE '%E-%' THEN LTRIM(RTRIM(CAST(CAST(CAST([AMOUNT]AS FLOAT) AS NVARCHAR)AS MONEY)))
WHEN [AMOUNT] = ' ' THEN NULL
ELSE [AMOUNT]
END AS [AMOUNT]
nightmare stuff.
ReplyDeleteThank you for the tips, Clay.
ReplyDeleteThanks for the meal!! But yeah, thanks for spending the time to talk about this matter here on your web page.
ReplyDeleteThanks, that was a really cool read! convert money online
ReplyDelete