need help with sql statement for a range

itmasterw

Registered User.
Local time
Today, 02:18
Joined
Oct 31, 2005
Messages
45
Hi, I have atable with ID ranges like this:
ID1 ID2 Logo
1 50 HO
51 75 HY
76 100 GM

I want to know how I would write a SQL statement that would find which logao given a certain input. So for example, If I had th euser enter 53 from a textbox on a form it should bring back HO. Can someone please help me with this.
This is the kind of thing that I tryed so far, but does not work:

SELECT Logo
FROM tblLogo
Where forms!frmTest!Text0 Between(ID1) (ID2);
 
Assuming ID1 and ID2 are numeric fields i.e. not text fields,

SELECT Logo
FROM tblLogo
Where forms!frmTest!Text0 Between [ID1] And [ID2]

.
 
That did it, I see the I missed the AND, thought I thought that I had put it in.
Thank You
 

Users who are viewing this thread

Back
Top Bottom