Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store decimal with letters and then display

Status
Not open for further replies.

jsteiner87

Programmer
Oct 9, 2003
76
US
I have a listing of items in a database and they have section numbers that are attached to these items. For example:

1.10 Item #1
1.20 Item #2
2.24 Item #3
11.00 Item #4

I currently have these stored as a decimal. Now I need to add letters onto some of these decimals.

1.10 Item #1
1.20 Item #2
2.24 Item #3
2.24n Item #5
11.00 Item #4

If I store the items as varchar they would sort like this.

1.10 Item #1
1.20 Item #2
11.00 Item #4
2.24 Item #3
2.24n Item #5

How can I store these section numbers and have a letter in with it and sort them in a numeric order?
 
this would be better posted on the related database forum, where incidentally it probably has been answered before.

i know this has been addressed in the mysql forum.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks, I will try over there. I didn't know if I could use PHP to sort this and store it as varchar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top