Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Critieria Problem

Status
Not open for further replies.

mbaddar

Programmer
May 10, 2001
120
US
Hi,

I have a long sql statement that I wrote in SQL mode (not in the design view). There is a very long sql statement in the code. Basically, there are three types of criteria that I'm checking for in the code. And, for each criteria there are two dates (status #1 for date #1 is compared against status #1 for date #2). I also have a message and third party information field that is compared the same way. For some reason in my design view the or line always reads <> false. I'm not sure why it's doing this. I didn't put <> false in my sql statement. This is my sql statement below. It's pretty long but mostly redundant.

The LRecs and MRecs are queries I'm using to get my date #1 and date #2 records. In addition to the problem I'm having with the &quot;false&quot; word, my query isn't working as it should.

Thanks for any help,
MBaddar

SELECT LRecs.*, MRecs.*
FROM MRecs LEFT JOIN LRecs ON MRecs.fld_RID = LRecs.fld_RID
WHERE (((LRecs.fld_Status)<>[MRecs]![fld_Status])) OR (((MRecs.fld_ThirdPartyInfo1)<>[LRecs]![fld_ThirdPartyInfo1])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo2)<>[LRecs]![fld_ThirdPartyInfo2])& &quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo3)<>[LRecs]![fld_ThirdPartyInfo3])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo4)<>[LRecs]![fld_ThirdPartyInfo4])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo5)<>[LRecs]![fld_ThirdPartyInfo5])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo6)<>[LRecs]![fld_ThirdPartyInfo6])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo7)<>[LRecs]![fld_ThirdPartyInfo7])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo8)<>[LRecs]![fld_ThirdPartyInfo8])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo9)<>[LRecs]![fld_ThirdPartyInfo9])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo10)<>[LRecs]![fld_ThirdPartyInfo10])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo11)<>[LRecs]![fld_ThirdPartyInfo11])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo12)<>[LRecs]![fld_ThirdPartyInfo12])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo13)<>[LRecs]![fld_ThirdPartyInfo13])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo14)<>[LRecs]![fld_ThirdPartyInfo14])&&quot;&quot;) OR (((MRecs.fld_ThirdPartyInfo15)<>[LRecs]![fld_ThirdPartyInfo15])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg1)<>[LRecs]![fld_RestrictedMsg1])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg2)<>[LRecs]![fld_RestrictedMsg2])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg3)<>[LRecs]![fld_RestrictedMsg3])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg4)<>[LRecs]![fld_RestrictedMsg4])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg5)<>[LRecs]![fld_RestrictedMsg5])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg6)<>[LRecs]![fld_RestrictedMsg6])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg7)<>[LRecs]![fld_RestrictedMsg7])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg8)<>[LRecs]![fld_RestrictedMsg8])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg9)<>[LRecs]![fld_RestrictedMsg9])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg10)<>[LRecs]![fld_RestrictedMsg10])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg11)<>[LRecs]![fld_RestrictedMsg11])&&quot;&quot;) OR (((MRecs.fld_RestrictedMsg12)<>[LRecs]![fld_RestrictedMsg12])&&quot;&quot;);

 

It appears that a ) is misplaced on several lines in the query.

(((MRecs.fld_ThirdPartyInfo1)<>[LRecs]![fld_ThirdPartyInfo1])&&quot;&quot;) OR

Change to

(((MRecs.fld_ThirdPartyInfo1)<>[LRecs]![fld_ThirdPartyInfo1]&&quot;&quot;)) OR Terry Broadbent
Please review faq183-874.

&quot;The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge.&quot; - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top