A
AccessARS
I have 2 different variations of an Access query which is referencing fields
on an open form for criteria. Unfortunately the statement with the IIF
greater then or less then operators in the HAVING statement does not return
results and does not error out...
The following statement works:
SELECT WFP.BucketS, WFP.Bucket, Count(WFP.Bucket) AS CountOfBucket
FROM WFP
GROUP BY WFP.BucketS, WFP.Bucket, WFP.LOB, WFP.Lead1, WFP.ConCode
HAVING (((WFP.LOB) Like "*" & [Forms]![Overview]![Indicator1]) AND
((WFP.Lead1) Like "*" & [Forms]![Overview]![Indicator2]) AND
((WF_Part1.CompanyCodeID)<2000)));
The following statement with an IIF in the HAVING criteria statement of
ConCode does not return results with the greater then and less then operators
but if I remove the > or < operators it seems to work:
SELECT WFP.BucketS, WFP.Bucket, Count(WFP.Bucket) AS CountOfBucket
FROM WFP
GROUP BY WFP.BucketS, WFP.Bucket, WFP.LOB, WFP.Lead1, WFP.ConCode
HAVING (((WFP.LOB) Like "*" & [Forms]![Overview]![Indicator1]) AND
((WFP.Lead1) Like "*" & [Forms]![Overview]![Indicator2]) AND ((WFP.ConCode)
Like
IIf([Forms]![Overview]![tgl_ChartsInFocus]=1,(WFP.ConCode)<2000,(WFP.ConCode)>2000)));
?????
I have tried searching for similar issues in the forum but have not had any
luck.
Thank you in advance for your help.
on an open form for criteria. Unfortunately the statement with the IIF
greater then or less then operators in the HAVING statement does not return
results and does not error out...
The following statement works:
SELECT WFP.BucketS, WFP.Bucket, Count(WFP.Bucket) AS CountOfBucket
FROM WFP
GROUP BY WFP.BucketS, WFP.Bucket, WFP.LOB, WFP.Lead1, WFP.ConCode
HAVING (((WFP.LOB) Like "*" & [Forms]![Overview]![Indicator1]) AND
((WFP.Lead1) Like "*" & [Forms]![Overview]![Indicator2]) AND
((WF_Part1.CompanyCodeID)<2000)));
The following statement with an IIF in the HAVING criteria statement of
ConCode does not return results with the greater then and less then operators
but if I remove the > or < operators it seems to work:
SELECT WFP.BucketS, WFP.Bucket, Count(WFP.Bucket) AS CountOfBucket
FROM WFP
GROUP BY WFP.BucketS, WFP.Bucket, WFP.LOB, WFP.Lead1, WFP.ConCode
HAVING (((WFP.LOB) Like "*" & [Forms]![Overview]![Indicator1]) AND
((WFP.Lead1) Like "*" & [Forms]![Overview]![Indicator2]) AND ((WFP.ConCode)
Like
IIf([Forms]![Overview]![tgl_ChartsInFocus]=1,(WFP.ConCode)<2000,(WFP.ConCode)>2000)));
?????
I have tried searching for similar issues in the forum but have not had any
luck.
Thank you in advance for your help.