I have a current query in an MS Access database that uses the Format() function to convert a number (long integer) to a string.
The table has been redesigned and moved to SQL server. The field I need to convert is not a money field that I need to drop everything after the period and convert it to a string with a certain number of characters.
Sample Data:
Amount
228.00000
1896.00000
6411.00000
317.00000
4830.00000
898.00000
1778.00000
1308.00000
45139.00000
424.00000
Current MS Access query:
SELECT Format(CallAmt],"000000000000000") AS Amount
FROM Fed
New query:
SELECT Convert(varchar(15), FedAmount)
FROM Fed.SM_T_Call
I would like my final Product to look like this:
Amount
000000000000228
000000000001896
000000000006411
000000000000317
000000000004830
000000000000898
000000000001778
000000000001308
000000000045139
000000000000424
I don't know how to drop everything after the period and add the extra zeros to my result. Can anyone offer any assistance?