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

Processing silly data using LIKE and <>

Status
Not open for further replies.

jimoblak

Instructor
Oct 23, 2001
3,620
US
I've got products that I am trying to select as a group of records from text fields:

B125
B150
B175
B200
C125
C150
C175
C200

I want to select the records that start with B but are in the range of B125 through B175.

Ex:
B125
B150
B175

So far I have:

SELECT * FROM table WHERE ((products LIKE 'B%') AND (.....??? ))

Can anyone clue me into how to select within the range found in the last portion of the text string? Should I shoot the previous database manager that created a data field of this type?



- - picklefish - -

Why is everyone in this forum responding to me as picklefish?
 
since I think your field is a char or varchar you can also do this

SELECT * FROM table WHERE products >= 'B125' and products <= 'B175'

 
Thanks - I had that before but got errors on a stray parenthesis elsewhere in the SQL. I assumed the error was in the mixed alpha-num string.

- - picklefish - -

Why is everyone in this forum responding to me as picklefish?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top