Unexpected select query Problem

  • Thread starter Thread starter Charles Russell
  • Start date Start date
C

Charles Russell

I am trying to run the following query.

SELECT [sycustmr].[dbw_autoinc], [sycustmr].[name],
[sycustmr].[addr3]
FROM sycustmr
WHERE InStr(1,[sycustmr]![addr3],",") = 0;

Compile error in query expression InStr(1,[sycustmr]!
[addr3],",") = 0

I can't see an error in this statement.
 
Hi Charles,

I may be wrong, but I believe that you are not allowed to
use the bang (!) in sql syntax. Try changing it to a
period and see if it will work.

One other thing, you may need to change your condition to
be equal to "0" since you are comparing against a string
field.

HTH

-Ted Allen
 
I have tried several variations of the suggestions so far
and I still get the error
-----Original Message-----
Try wrapping the comma in single quotes instead of double.

HTH
Dale
-----Original Message-----
I am trying to run the following query.

SELECT [sycustmr].[dbw_autoinc], [sycustmr].[name],
[sycustmr].[addr3]
FROM sycustmr
WHERE InStr(1,[sycustmr]![addr3],",") = 0;

Compile error in query expression InStr(1,[sycustmr]!
[addr3],",") = 0

I can't see an error in this statement.
.
.
 
Tried that it still gives me the error
-----Original Message-----
Try wrapping the comma in single quotes instead of double.

HTH
Dale
-----Original Message-----
I am trying to run the following query.

SELECT [sycustmr].[dbw_autoinc], [sycustmr].[name],
[sycustmr].[addr3]
FROM sycustmr
WHERE InStr(1,[sycustmr]![addr3],",") = 0;

Compile error in query expression InStr(1,[sycustmr]!
[addr3],",") = 0

I can't see an error in this statement.
.
.
 
Is Addr3 ever null? If so, that could be causing the problem.

Try forcing the null to be a zero-length string.

WHERE InStr(1,[sycustmr].[addr3] & "",",") = 0

Of course you could use criteria of

WHERE Addr3 Like "*,*" OR Addr3 Is Null
 
Thanks that did it
-----Original Message-----
Is Addr3 ever null? If so, that could be causing the problem.

Try forcing the null to be a zero-length string.

WHERE InStr(1,[sycustmr].[addr3] & "",",") = 0

Of course you could use criteria of

WHERE Addr3 Like "*,*" OR Addr3 Is Null



Charles said:
I am trying to run the following query.

SELECT [sycustmr].[dbw_autoinc], [sycustmr].[name],
[sycustmr].[addr3]
FROM sycustmr
WHERE InStr(1,[sycustmr]![addr3],",") = 0;

Compile error in query expression InStr(1,[sycustmr]!
[addr3],",") = 0

I can't see an error in this statement.
.
 
Back
Top