Storing the value 090 to a numeric data type

  • Hi all

    I want to be able to store the value 090 into a table without any decimal point etc, what would be the correct data type to use.

    I want to keep the leading 0 and not use varchar, char etc.

    Thanks

     


    Kindest Regards,

    John Burchel (Trainee Developer)

  • My understanding is that 090 is 90.  An int will convert it.

    Your best bet is to use a varchar field with a constraint on it.

    Unless anyone knows better?

  • Store as int or tinyint. Then convert client side when displaying the data.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply