Doews Anybody see what the syntax error is in this::::::
strquery = ("SELECT * FROM RepoInventory WHERE repoinventory.RepoStatusID = " & "'" & 23 & "'" & "And RepoInventory.AccountTypeID = " & "'" & 4 & "'")
Thanks
Printable View
Doews Anybody see what the syntax error is in this::::::
strquery = ("SELECT * FROM RepoInventory WHERE repoinventory.RepoStatusID = " & "'" & 23 & "'" & "And RepoInventory.AccountTypeID = " & "'" & 4 & "'")
Thanks
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 :D
"%" (or "*" depending on the DBMS) are only used with "LIKE" statements. Equality conditions expect the value to match exactly.
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"