I have two queries, SQL is as follows:
SELECT DISTINCT GAPS.GAPID
FROM GAPS
WHERE (((Month([Recieved]))=[Enter month (1-12):]) And ((Year([Recieved]))=[Enter year (yyyy):]) And (([GAPS].[Track])="EDI" And (([GAPS].[Status])="Completed");
SELECT DISTINCT GAPS.GAPID
FROM GAPS
WHERE (((Month([Recieved]))=[Enter month (1-12):]) AND ((Year([Recieved]))=[Enter year (yyyy):]) AND ((GAPS.Track)="EDI");
As you can see, they're pretty similar except for the extra criteria in the first one, and prompt for the same two fields. I made a report for each query that counts the number of records returned, respectively, then I added the two reports to another report (as subreports). When I open this last report, it prompts me for the month and the year twice (well, 4 prompts actually), twice for each query, and I have to input the same month/year for each. Is there a way of rewriting these so that I only have to answer once (just two prompts)? Thanks.
SELECT DISTINCT GAPS.GAPID
FROM GAPS
WHERE (((Month([Recieved]))=[Enter month (1-12):]) And ((Year([Recieved]))=[Enter year (yyyy):]) And (([GAPS].[Track])="EDI" And (([GAPS].[Status])="Completed");
SELECT DISTINCT GAPS.GAPID
FROM GAPS
WHERE (((Month([Recieved]))=[Enter month (1-12):]) AND ((Year([Recieved]))=[Enter year (yyyy):]) AND ((GAPS.Track)="EDI");
As you can see, they're pretty similar except for the extra criteria in the first one, and prompt for the same two fields. I made a report for each query that counts the number of records returned, respectively, then I added the two reports to another report (as subreports). When I open this last report, it prompts me for the month and the year twice (well, 4 prompts actually), twice for each query, and I have to input the same month/year for each. Is there a way of rewriting these so that I only have to answer once (just two prompts)? Thanks.