Jan 25, 2007 #1 RustyAfro Programmer Joined Jan 12, 2005 Messages 332 Location US I have a simple cast statement CAST(aNumber AS VARCHAR(10)) that makes the number 111 to '111.' Can anyone tell me how to do the CAST properly so that the decimal is not included in the casted string?
I have a simple cast statement CAST(aNumber AS VARCHAR(10)) that makes the number 111 to '111.' Can anyone tell me how to do the CAST properly so that the decimal is not included in the casted string?
Jan 25, 2007 1 #2 blom0344 Technical User Joined Mar 20, 2002 Messages 3,441 Location NL try: Code: REPLACE(CAST (aNumber AS VARCHAR(10)),'.','') OR: Code: CAST (INT(aNumber) AS VARCHAR(10)) Ties Blom Upvote 0 Downvote
try: Code: REPLACE(CAST (aNumber AS VARCHAR(10)),'.','') OR: Code: CAST (INT(aNumber) AS VARCHAR(10)) Ties Blom
Jan 26, 2007 Thread starter #3 RustyAfro Programmer Joined Jan 12, 2005 Messages 332 Location US I used the second solution. Thanks Upvote 0 Downvote