Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Missing operator: fresh eyes needed

Author  Topic 

foamy
Starting Member

12 Posts

Posted - 2008-11-04 : 09:31:25
I'm getting an error about a missing operator and I've narrowed it down to this:

WHERE
(
((Model = 119 OR Model = 140 OR Model = 177 OR Model = 190 OR Model = 222 OR Model = 223 OR Model = 225 OR Model = 272) AND (ArriveDate < #04-07-2008#))
OR
((Model != 119 AND Model != 140 AND Model != 177 AND Model != 190 AND Model != 222 AND Model != 223 AND Model != 225 AND Model != 272) AND (ArriveDate < #04-05-2008#))
)

Help please :(

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-04 : 09:34:38
Are you using Access or SQL Server?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

foamy
Starting Member

12 Posts

Posted - 2008-11-04 : 09:35:19
Access, I should have specified...

EDIT: I'm executing this from within a .NET application against an Access 97 database... I thought that might matter.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-04 : 09:39:03
moved to appropriate forum.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

Sequin
Starting Member

25 Posts

Posted - 2008-11-26 : 11:35:29
Try this:

WHERE
(
(Model IN (119,140,177,190,222,223,225,272) AND (ArriveDate < #04-07-2008#))
OR
(Model NOT IN (119,140,177,190,222,223,225,272) AND (ArriveDate < #04-05-2008#))
)

Go to Top of Page
   

- Advertisement -