If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > qyury about numeric values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-02-08, 02:37
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
Smile qyury about numeric values

Hi

I want to write numeric value just as 03 not in 3 how can we do this
Reply With Quote
  #2 (permalink)  
Old 05-02-08, 03:41
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
"03" is not a numeric value, it is textual, and as such you will have to convert it appropriately.
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 05-02-08, 04:18
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
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
Reply With Quote
  #4 (permalink)  
Old 05-02-08, 04:38
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On