Don't include certain field paramater

S

Supe

I have the code below that was set up by someone else that I need to make an
adjustment to. I don't want to include any items where the ClientCode is
equal to NO MATCH. How do I change this code to reflect that?

Set tempT = CurrentDb.OpenRecordset("SELECT Branch, ClientCode, WhsCode,
dum1, UPCCase, SVSize, SVDescription, SVItemCd, dum2, dum3, dum4, dum5,
SVSell, dum6, SVPack, ConvFact, Factor, dum7, dum8, dum9, dum10, dum11,
dum12, SVPltQty, SVStatus FROM Results WHERE id <= " & incre & ";",
dbOpenDynaset)
 
M

Marshall Barton

Supe said:
I have the code below that was set up by someone else that I need to make an
adjustment to. I don't want to include any items where the ClientCode is
equal to NO MATCH. How do I change this code to reflect that?

Set tempT = CurrentDb.OpenRecordset("SELECT Branch, ClientCode, WhsCode,
dum1, UPCCase, SVSize, SVDescription, SVItemCd, dum2, dum3, dum4, dum5,
SVSell, dum6, SVPack, ConvFact, Factor, dum7, dum8, dum9, dum10, dum11,
dum12, SVPltQty, SVStatus FROM Results WHERE id <= " & incre & ";",
dbOpenDynaset)


Man is that one scary field list ,or what?

Change the WHERE clause to something more like:

.... WHERE id <= " & incre & " AND ClientCode<>/
 
S

Steve Schapel

Supe,

I think it is probably:

"... FROM Results WHERE id <= " & incre & " AND [ClientCode] <> 'NO
MATCH'", dbOpenDynaset)
 
M

Marshall Barton

Supe said:
I have the code below that was set up by someone else that I need to make an
adjustment to. I don't want to include any items where the ClientCode is
equal to NO MATCH. How do I change this code to reflect that?

Set tempT = CurrentDb.OpenRecordset("SELECT Branch, ClientCode, WhsCode,
dum1, UPCCase, SVSize, SVDescription, SVItemCd, dum2, dum3, dum4, dum5,
SVSell, dum6, SVPack, ConvFact, Factor, dum7, dum8, dum9, dum10, dum11,
dum12, SVPltQty, SVStatus FROM Results WHERE id <= " & incre & ";",
dbOpenDynaset)


That field list made my fingers jumpy ;-)

.... WHERE id <= " & incre & " AND ClientCode<>'NO MATCH' "
 
Top