I have a column with money data type, having varying length values. How can I make these values to be fixed in length? For example a value of 3.30 should be displayed as 000003.30
I think you will have to manually write in some code in your select statement or application code to do that. Else you'll have to save it as character string and format it before storing. Gaurav Moderator Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard
DECLARE @AMOUNT MONEY -- INPUT DATA ,@LENGTH INT -- DESIRED FIXED LENGTH SELECT @AMOUNT = 3.30 ,@LENGTH = 9 SELECT REPLICATE('0', @LENGTH - LEN(CAST(@AMOUNT AS VARCHAR(10)))) + CAST(@AMOUNT AS VARCHAR(10)) Gaurav Moderator Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard