|
-
Mar 29th, 2000, 09:19 PM
#1
Thread Starter
Lively Member
Doews Anybody see what the syntax error is in this::::::
strquery = ("SELECT * FROM RepoInventory WHERE repoinventory.RepoStatusID = " & "'" & 23 & "'" & "And RepoInventory.AccountTypeID = " & "'" & 4 & "'")
Thanks
-
Mar 29th, 2000, 09:37 PM
#2
Hyperactive Member
Don't think you need quotes around the numbers
Hey VB,
I don't think you need the quotes around your numbers. If you table is setup with those fields as integers( long, single, whatever) you cannt use quotes. Use quotes only for text.
In issence, your query should look something like this:
strquery = ("SELECT * FROM RepoInventory WHERE repoinventory.RepoStatusID = " & 23 & "And RepoInventory.AccountTypeID = " & 4)
That may be wrong, but it should be close. You may need the "%" sign in there before and after your numbers.
If you do a search using "SQL" under Database Development, you should find something.
Let us know
JazzBass 
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
Mar 30th, 2000, 12:33 AM
#3
Frenzied Member
"%" (or "*" depending on the DBMS) are only used with "LIKE" statements. Equality conditions expect the value to match exactly.
-
Mar 30th, 2000, 12:38 AM
#4
Also in this case he is using hard coded numbers, so the SQL statement could be like this:
SELECT * FROM RepoInventory WHERE repoinventory.RepoStatusID = 23 And RepoInventory.AccountTypeID = 4"
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
|