Hello
I have 3 tables A,B,C linked by A.id
i need a query something like
select A.des,B.df_date,C.nxt_date,A.id
from A
inner join B
on A.id=B.id
inner join C
on A.id=C.id
where
(if A.des='P Sale' then B.df_date between '08/01/2002'and '08/31/2002'
elseif A.des='AFB' then C.nxt_date
between '08/01/2002'and '08/31/2002')
Please advice
Thanks
A.des B.df_date C. nxt_date A.ID
------------------------------ ---------------------------
P Sale 2002-04-15 2001-09-01 1
P Sale 2002-06-14 2001-07-01 2
P Sale 2002-06-17 2001-07-01 3
P Sale 2002-08-16 2001-02-01 5
AFB 2002-04-16 2002-04-01 6
AFB 2002-06-10 2002-02-01 9
AFB 2002-08-09 2002-09-01 7
I have 3 tables A,B,C linked by A.id
i need a query something like
select A.des,B.df_date,C.nxt_date,A.id
from A
inner join B
on A.id=B.id
inner join C
on A.id=C.id
where
(if A.des='P Sale' then B.df_date between '08/01/2002'and '08/31/2002'
elseif A.des='AFB' then C.nxt_date
between '08/01/2002'and '08/31/2002')
Please advice
Thanks
A.des B.df_date C. nxt_date A.ID
------------------------------ ---------------------------
P Sale 2002-04-15 2001-09-01 1
P Sale 2002-06-14 2001-07-01 2
P Sale 2002-06-17 2001-07-01 3
P Sale 2002-08-16 2001-02-01 5
AFB 2002-04-16 2002-04-01 6
AFB 2002-06-10 2002-02-01 9
AFB 2002-08-09 2002-09-01 7