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

between error with numbers

Status
Not open for further replies.

chaft

Technical User
Feb 7, 2008
55
GB
I have a problem with my between statement. I have two textboxes with values in and I want to be shown the records that match between the values.


Simple?

well yes it should be. The problem is that the statement only compares the first number and not the others.

so

between the values of 1 and 9 it brings up all my results. This is wrong as I have values such as '50' and '394'. They should not be coming up when I am putting in '1' and '9' in the textboxes.

The query only works on the first number...

so between the values of "394" and "2400" the computer only works with "3" and "2" and thereby brings up no records at all. There must be something simple causing this. Can anyone help?
 
Are you sure the field is defined as numeric .

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
the field is defined as long integer
 
I must apologise. It was a mistake by me.

I had put trim(fieldname)& "" at the top

and this was the reason why it wasn't working as it should.

whoops.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top