freelance84 Posted August 22, 2010 Share Posted August 22, 2010 Is it possible to have a field (int) to start with 2 zeros? eg, 00123 I have tried inputting the above value, but the sql table automatically rids them and inputs 123?? Quote Link to comment Share on other sites More sharing options...
watsmyname Posted August 22, 2010 Share Posted August 22, 2010 Is it possible to have a field (int) to start with 2 zeros? eg, 00123 I have tried inputting the above value, but the sql table automatically rids them and inputs 123?? datatype should be varchar for that. By the way you can prefix "00" in code, while you fetch data from the database Quote Link to comment Share on other sites More sharing options...
freelance84 Posted August 22, 2010 Author Share Posted August 22, 2010 Yea i thought as much, was hoping there was some setting somewhere that might over ride this. I've gone with varchar. Cheers Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 22, 2010 Share Posted August 22, 2010 You can specify leading zeros and the display length on an INT data type column definition. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.