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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to compare different datatypes?

Status
Not open for further replies.

TGJ

Programmer
Jan 31, 2005
64
CA
I have values stored in a table as type varchar ex: 1, 2, 3, 3A, 4, 4A, 4B, 5, etc.

I need to be able to compare these values to one another such that 1<2, 2<3, 3<3A, 3A<4, etc.

everything works fine until I get into the values that contain letters.

Any sugestions??

Thanks
Terry
 
Therre should be no problem there, as long as the values are compared as strings. For example, '3'<'3A' is true, but 3<'3A' is false. If the fields are declared as strings, then that would happen automatically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top