Ok you lost me a little bit.
Here is my current where clause.
WHERE (pshstj.workday BETWEEN @StartDate AND @EndDate) AND (NOT
(pshstj.trn = 'RO1' OR
pshstj.trn = 'WO1' OR
pshstj.trn = 'XXX')) AND (pshstj.empid =
@ClockNo)
The "@clockno" section is where I prompt them for a clock number.
If I put a * it doesn't work. If I put a good number in it works fine.
Where does your 'where' clause fit into this?
> Your where clause should be written like this:
>
[quoted text clipped - 20 lines]
> >
> > Any ideas?
Topher - 29 Nov 2006 20:43 GMT
I'd write an IIF statement (either in a stored procedure, or in the
Report Query):
IF @clockno = '*'
BEGIN
select ....
from ...
where (pshstj.workday BETWEEN @StartDate AND @EndDate) AND (NOT
(pshstj.trn = 'RO1' OR
pshstj.trn = 'WO1' OR
pshstj.trn = 'XXX'))
END
ELSE
BEGIN
select ..
from ..
where (pshstj.workday BETWEEN @StartDate AND @EndDate) AND (NOT
(pshstj.trn = 'RO1' OR
pshstj.trn = 'WO1' OR
pshstj.trn = 'XXX')) AND (pshstj.empid =
@ClockNo)
END
> Ok you lost me a little bit.
>
[quoted text clipped - 35 lines]
> > >
> > > Any ideas?
Andrei - 29 Nov 2006 22:30 GMT
WHERE (pshstj.workday BETWEEN @StartDate AND @EndDate)
AND (NOT
(pshstj.trn = 'RO1' OR
pshstj.trn = 'WO1' OR
pshstj.trn = 'XXX'))
AND
(
(isnull(@ClockNo, '*') = '*')
or
( (isnull(@ClockNo, '*') <> '*') and (pshstj.empid =
lockNo) )
)
> Ok you lost me a little bit.
>
[quoted text clipped - 37 lines]
>> >
>> > Any ideas?
Bruce Lawrence - 30 Nov 2006 16:19 GMT
Andrei,
I'm not sure how... but it works.
I love you