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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria Parameter Query

Status
Not open for further replies.

knuckelhead

Technical User
Aug 8, 2002
228
US
i have a table text field named OldProdhier. I want to have One Qry ask me a question. It is on the criteria line in the qry:

[Enter Not Like Meat Cultures or Meat Cultures]

There are only 2 answer situation.

I want to type in ..... Not Like Meat Cultures
to get the 1st answer. I want to type in Meat cultures to get the 2nd answer.

However, i get no records back. But when i take out the parameter and manually hardcode 1 answer to the qry and run it, i get the proper work done.

So why is my parameter wrong?
 
Suggest you send the query and more info to help us understand.
 
i presently have the query hard coded on the criteria line with: Not Like "meat*" in the 'Old Prodhier' qry field.

I would like to have on the 'Old Prodhier' field criteria line say something to the effect:
[Enter Not Meat* or Meat*]

I tried the fullname of Meat Cultures, thinking maybe the *star was the culprit, but it was not.
Knucklehead
here is the sQL

--------------------------------------
SELECT tblSoldto.Affiliate, [100Qry-4000Union].FormulaID, tblFormulaMain.FormulaName, tblProdhierarchy.ProdHierName AS [New Prodhier], tblProdhierarchyOLD.ProdHierNameOLD, tblProdhierarchyOLD.ProdHier2 AS [Old Prodhier], Nz([Q10])+Nz([Q11])+Nz([Q12]) AS [Last 3 Mth QtyStu], Nz([R10])+Nz([R11])+Nz([R12]) AS [Last 3 Mth Rev$], Val(round((Nz([R10])+Nz([R11])+Nz([R12]))/3,0)) AS [Last 3 Mth Avg Mth Rev$total], Nz([Q1])+Nz([Q2])+Nz([Q3])+Nz([Q4])+Nz([Q5])+Nz([Q6])+Nz([Q7])+Nz([Q8])+Nz([Q9])+Nz([Q10])+Nz([Q11])+Nz([Q12]) AS QtyStuTotal, Nz([R1])+Nz([R2])+Nz([R3])+Nz([R4])+Nz([R5])+Nz([R6])+Nz([R7])+Nz([R8])+Nz([R9])+Nz([R10])+Nz([R11])+Nz([R12]) AS [Rev$Total], Val(round(nz([Rev$total])/12,0)) AS [Avg 12 Mth Rev$total], Sum(tbl2005A.QtyStu05A7) AS Q1, Sum(tbl2005A.QtyStu05A8) AS Q2, Sum(tbl2005A.QtyStu05A9) AS Q3, Sum(tbl2005A.QtyStu05A10) AS Q4, Sum(tbl2005A.QtyStu05A11) AS Q5, Sum(tbl2005A.QtyStu05A12) AS Q6, Sum(tbl2006A.QtyStu06A1) AS Q7, Sum(tbl2006A.QtyStu06A2) AS Q8, Sum(tbl2006A.QtyStu06A3) AS Q9, Sum(tbl2006A.QtyStu06A4) AS Q10, Sum(tbl2006A.QtyStu06A5) AS Q11, Sum(tbl2006A.QtyStu06A6) AS Q12, Sum(tbl2005A.[Rev$05A7]) AS R1, Sum(tbl2005A.[Rev$05A8]) AS R2, Sum(tbl2005A.[Rev$05A9]) AS R3, Sum(tbl2005A.[Rev$05A10]) AS R4, Sum(tbl2005A.[Rev$05A11]) AS R5, Sum(tbl2005A.[Rev$05A12]) AS R6, Sum(tbl2006A.[Rev$06A1]) AS R7, Sum(tbl2006A.[Rev$06A2]) AS R8, Sum(tbl2006A.[Rev$06A3]) AS R9, Sum(tbl2006A.[Rev$06A4]) AS R10, Sum(tbl2006A.[Rev$06A5]) AS R11, Sum(tbl2006A.[Rev$06A6]) AS R12
FROM ((tbl2006A RIGHT JOIN (tbl2005A RIGHT JOIN ((tblFormulaMain LEFT JOIN tblProdhierarchyOLD ON tblFormulaMain.ProdhierarchyOLD = tblProdhierarchyOLD.ProdhierarchyOLD) RIGHT JOIN [100Qry-4000Union] ON tblFormulaMain.FormulaID = [100Qry-4000Union].FormulaID) ON (tbl2005A.FormulaID = [100Qry-4000Union].FormulaID) AND (tbl2005A.ShiptoID = [100Qry-4000Union].ShiptoID) AND (tbl2005A.SoldtoID = [100Qry-4000Union].SoldtoID)) ON (tbl2006A.FormulaID = [100Qry-4000Union].FormulaID) AND (tbl2006A.ShiptoID = [100Qry-4000Union].ShiptoID) AND (tbl2006A.SoldtoID = [100Qry-4000Union].SoldtoID)) LEFT JOIN tblSoldto ON [100Qry-4000Union].SoldtoID = tblSoldto.SoldtoID) LEFT JOIN tblProdhierarchy ON tblFormulaMain.Prodhierarchy = tblProdhierarchy.Prodhierarchy
GROUP BY tblSoldto.Affiliate, [100Qry-4000Union].FormulaID, tblFormulaMain.FormulaName, tblProdhierarchy.ProdHierName, tblProdhierarchyOLD.ProdHierNameOLD, tblProdhierarchyOLD.ProdHier2
HAVING (((tblSoldto.Affiliate) Like "TYSON PREPARED*") AND ((tblProdhierarchyOLD.ProdHier2) Not Like "meat*"))
ORDER BY [100Qry-4000Union].FormulaID;
---------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top