G
Guest
I currently have the following query:
SELECT dbo_myvDeltaT.jobnum, dbo_mytShortages.class
FROM dbo_myvDeltaT INNER JOIN dbo_mytShortages ON dbo_myvDeltaT.jobnum =
dbo_mytShortages.jobnum
WHERE (((dbo_mytShortages.class) In ("SMP","MFC")));
I would like to use a function to set the criteria for the IN() clause such
that the bottom line would read:
WHERE (((dbo_mytShortages.class) In (SetClass())));
or it could read
WHERE (((dbo_mytShortages.class) SetClass()));
The SetClass() function would be fed a string such as "'SMP', MFC'" as it's
return value.
It would also have to understand the '*' character for all records.
I have used message boxes to verify that I am getting what I am looking for
out of the function, but it will not work in the query. I can't use this one
only in code as a second query has to run off of this one to then be joined
to a table in a third query to limit the records that will be used in a
report.
My boss wants to not have reports show up if there are no records in it's
sub report while there is data for the main report and the criteria for the
sub report is set in code on report open since you can't send criteria to a
sub report any other way.
I hope what I have written makes sense as I really need to find an answer
for this.
Thanks in advance!
SELECT dbo_myvDeltaT.jobnum, dbo_mytShortages.class
FROM dbo_myvDeltaT INNER JOIN dbo_mytShortages ON dbo_myvDeltaT.jobnum =
dbo_mytShortages.jobnum
WHERE (((dbo_mytShortages.class) In ("SMP","MFC")));
I would like to use a function to set the criteria for the IN() clause such
that the bottom line would read:
WHERE (((dbo_mytShortages.class) In (SetClass())));
or it could read
WHERE (((dbo_mytShortages.class) SetClass()));
The SetClass() function would be fed a string such as "'SMP', MFC'" as it's
return value.
It would also have to understand the '*' character for all records.
I have used message boxes to verify that I am getting what I am looking for
out of the function, but it will not work in the query. I can't use this one
only in code as a second query has to run off of this one to then be joined
to a table in a third query to limit the records that will be used in a
report.
My boss wants to not have reports show up if there are no records in it's
sub report while there is data for the main report and the criteria for the
sub report is set in code on report open since you can't send criteria to a
sub report any other way.
I hope what I have written makes sense as I really need to find an answer
for this.
Thanks in advance!