Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default not like syntax in querry not working

Hello all- I am pulling data from an access dbase and have ran into a syntax
issue. Does anyone what is wrong with the last line? The data pulls, but
ignore the not like statements and i get all the items with gfm and cfm in
the material name along with the data im looking for. I need to exclude all
records with GFM or CFM in the material field. Please help

strsql = "SELECT PEGG_TASSRAW.Plnt, PEGG_TASSRAW.Material,
CJI3ByReplen.Description, CJI3ByReplen.PurchDoc, PEGG_TASSRAW.[Replenishment
Element], PEGG_TASSRAW.[Grouping WBS el], PEGG_TASSRAW.[Assigned WBS],
PEGG_TASSRAW.[In Stock], PEGG_TASSRAW.Surplus, PEGG_TASSRAW.Scrap,
PEGG_TASSRAW.Loss, PEGG_TASSRAW.[Target Qty], PEGG_TASSRAW.[Created on],
CJI3ByReplen.[SumOfValue TCur], PEGGTASSONLY_ANALYST.Analyst,
PEGGTASSONLY_ANALYST.Comments, PEGGTASSONLY_ANALYST.Category,
PEGGTASSONLY_ANALYST.Actionee " _
& "FROM ((CJI3ByReplen RIGHT JOIN PEGG_TASSRAW ON CJI3ByReplen.Material =
PEGG_TASSRAW.Material) LEFT JOIN PEGGTASSONLY_ANALYST ON
PEGG_TASSRAW.Material = PEGGTASSONLY_ANALYST.Material) LEFT JOIN Controllers
ON PEGG_TASSRAW.Material = Controllers.Material " _
& "GROUP BY PEGG_TASSRAW.Plnt, PEGG_TASSRAW.Material,
CJI3ByReplen.Description, CJI3ByReplen.PurchDoc, PEGG_TASSRAW.[Replenishment
Element], PEGG_TASSRAW.[Grouping WBS el], PEGG_TASSRAW.[Assigned WBS],
PEGG_TASSRAW.[In Stock], PEGG_TASSRAW.Surplus, PEGG_TASSRAW.Scrap,
PEGG_TASSRAW.Loss, PEGG_TASSRAW.[Target Qty], PEGG_TASSRAW.[Created on],
CJI3ByReplen.[SumOfValue TCur], PEGGTASSONLY_ANALYST.Analyst,
PEGGTASSONLY_ANALYST.Comments, PEGGTASSONLY_ANALYST.Category,
PEGGTASSONLY_ANALYST.Actionee " _
& HAVING (((PEGG_TASSRAW.Material) Not Like [%gfm%] And
(PEGG_TASSRAW.Material) Not Like [%cfm%]) AND ((CJI3ByReplen.PurchDoc) Is
Null));

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use two different value to run a querry Arnaud Excel Discussion (Misc queries) 0 March 9th 07 10:28 AM
Newly created Get Function is not working when I copied the syntax from a working function CJ Excel Programming 1 January 16th 07 05:28 AM
COMPARING DATES with nested IF not working- Syntax is correct though Richard Flame Excel Discussion (Misc queries) 2 July 12th 06 07:04 PM
Web Querry stopped working Madiya Excel Programming 9 July 7th 06 07:28 AM
My syntax not working with Auto Open procedure Graham[_5_] Excel Programming 2 April 1st 04 05:08 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"