|
-
Sep 24th, 2002, 04:33 PM
#1
Thread Starter
Addicted Member
help with ADO Sql statement
What is wrong with this code? It tells me missing operator error.
I want my results to be ordered by ProductCode and be between StartPlu and EndPlu...
rsOrderDetails.Open "SELECT * From OrderDetails ORDER BY ProductCode WHERE ProductCode >= " & StartPlu & " and ProductCode <= " & EndPlu & "", CN, , adLockOptimistic
-
Sep 24th, 2002, 04:34 PM
#2
Addicted Member
Re: help with ADO Sql statement
Originally posted by TSur
What is wrong with this code? It tells me missing operator error.
I want my results to be ordered by ProductCode and be between StartPlu and EndPlu...
rsOrderDetails.Open "SELECT * From OrderDetails ORDER BY ProductCode WHERE ProductCode >= " & StartPlu & " and ProductCode <= " & EndPlu & "", CN, , adLockOptimistic
Order By is ALWAYS the last thing in an SQL statement. Put the WHERE clause before it.
-
Sep 24th, 2002, 04:36 PM
#3
Need-a-life Member
Try this:
VB Code:
rsOrderDetails.Open "SELECT * From OrderDetails WHERE ProductCode >= " & _
StartPlu & " and ProductCode <= " & EndPlu & " ORDER BY ProductCode", _
CN, , adLockOptimistic
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|