Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Smile Unanswered: qyury about numeric values

    Hi

    I want to write numeric value just as 03 not in 3 how can we do this

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    "03" is not a numeric value, it is textual, and as such you will have to convert it appropriately.
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2007
    Posts
    197

    Smile

    Quote Originally Posted by georgev
    "03" is not a numeric value, it is textual, and as such you will have to convert it appropriately.
    Thanks buddy

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    thats to do with your presentation layer, where you actually use the data, rather than where you store the data.

    Although it can be attractive to store the number as 03, or dates as 02/05/2007 it often becomes a real pain when it comes to sorting or manipulating data.

    if you store numbers as text then you have to store every number in the same manner, you have to know the magnitude of the number range so you can pad numbers accordingly with zeros or spaces other wise your sort order is banjaxed eg 1,10,11,12..19,2,20...29......
    if you store dates as text its very difficult to say find rows in a specific period
    say you wanted to compare sales in May for the last 5 years, or you wanted to analyse sales in the first 7 days of a month... you loose the ability to use the MySQL date functions

    moral of the tale, unless you have a really really good reason store values in the most appropriate datatype, handle formatting issues in the presentation layer
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •