error 3075 in query

jvdpeet

New member
Local time
Today, 06:01
Joined
Apr 14, 2011
Messages
8
Hello,
I get error 3075 in the following query in Visual Basic 6.0:
datQueryParTest.RecordSource = "SELECT * FROM Parametertest WHERE Winst + Verlies <> 0 & Chr(34) & ORDER BY AantalPerioden, Ondergrens, Bovengrens, (Winst + Verlies)"

What is missing in this query?


Jan van der Peet
 
Try...
datQueryParTest.RecordSource = "SELECT * FROM Parametertest WHERE Winst + Verlies <> 0 ORDER BY AantalPerioden, Ondergrens, Bovengrens, (Winst + Verlies)"
Cheers,
 
Thank you lagbolt for your reply, but this gives the same error.


Jan
 
Just a thought ---

Are all of the fields really in table Parametertest ?
Are they spelled correctly?
Is it possible that Winst + Verlies is NULL?
 
is it the orderby parameter (Winst + Verlies) that is the issue. It seems an unusual usage. Take this out and see if it works.

Indeed, construct a visual query, and see what the SQL looks like.
 
There should be no ampersand symbol before the ORDER BY statement.

Try this

datQueryParTest.RecordSource = "SELECT * FROM Parametertest WHERE (Winst + Verlies) <> (0 & Chr(34)) ORDER BY AantalPerioden, Ondergrens, Bovengrens, (Winst + Verlies);"
 
Thank you Red17. I removed it and the result is the same.

Jan
 

Users who are viewing this thread

Back
Top Bottom