AC5FF
Registered User.
- Local time
- Today, 07:45
- Joined
- Apr 6, 2004
- Messages
- 552
This one should be easy; but my brain ain't catching it ....
I want to be able to choose to run a report based upon shop selection; which is selected via a drop-down on a form. That part is working fine. However I would like to run this query so that both shops are included in the results.
The drop down lists; Shop1, Shop2, Shop3, All
The query (design view -- i'm still no good at SQL) has a "Where" field that uses an IIF statement:
The ??????? here is what is confusing me. Is there anything (wildcard?) that I can put into this IIF statement that will select ALL shops? (basically ignore the WHERE clause)??
I have gone ahead and copied the SQL here.. hopefully it'll show more what I'm looking for:
It's that "HAVING" line i guess that's tripping me up. BTW: I used "***" here because the field is only 3char long.
I want to be able to choose to run a report based upon shop selection; which is selected via a drop-down on a form. That part is working fine. However I would like to run this query so that both shops are included in the results.
The drop down lists; Shop1, Shop2, Shop3, All
The query (design view -- i'm still no good at SQL) has a "Where" field that uses an IIF statement:
Code:
IIf([forms]![report].[combo41]="All", ??????? ,[forms]![report].[combo41])
I have gone ahead and copied the SQL here.. hopefully it'll show more what I'm looking for:
Code:
INSERT INTO [Report Card] ( Product, Part, Repaired )
SELECT product.Abbr, product.part, Sum(IIf(work!status=4 And work!code=11 And work![tin date] Between DateSerial(Year(forms![report].combo31),Month(forms![report].combo31),1) And DateSerial(Year(forms![report].combo31),Month(Forms![report].combo31)+1,0),1,0)) AS Repaired
FROM Area INNER JOIN (lru INNER JOIN [Work] ON product.ID = Work.[product ID]) ON Area.ID = lru.Team
WHERE (((lru.quotas)=True))
GROUP BY product.Abbr, product.part, Area.name
HAVING (((Area.name)=IIf([forms]![report].[combo41]="All","***",[forms]![report].[combo41])));