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

SQL Statement Not Returning Everything

Status
Not open for further replies.

Rob7

Programmer
Dec 12, 2001
152
US
Hi All,
I have a flex project that I'm working on and in the project I am taking a range of part numbers from user entered data and trying to get an inclusive list of part numbers based on that range. The only problem is that I don;t get the the inclusion of the last part number. For example, I use a start of A0000 and and End of C9999. What I get is all the part numbers starting with A and B but no C. If I change and make the End Number a D, then I get all the A, B and C part numbers but no D part numbers.

rs_1.Open "SELECT item_no FROM IMITMIDX_SQL WHERE item_no BETWEEN '" & StartNbr & "' AND '" & EndNbr & "'"

That is the SQL statement. I have tried all sorts of combinations but either the staement fails to return a recordset or the last part number is not included.

Any suggestions?

Rob
 
Do you have an example of your data. I would like to see an actual part number that Starts with "C" that is not included in your recordset but is included when you change to "D"

Thanks

Andy

Andy Baldwin
 
It is the demo data included with Macola 7x. I have not tried this with client data yet. If you need that I can zip the file and send it to you.

Rob
 
Just a suggestion, make the last line CZZZZZZ and try it again.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Well, that worked. I guess I don't exactly know why but it did. I will have to see how this works with the client data. Thanks Don.

Rob
 
Rob,

C99999 would exclude ANYTHING that starts with C and another letter like CAT, COWBOY, etc.

Numbers are sorted before letters.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top