- Sep 11, 2004
- 14
- 0
- 0
Hi There,
Can you please help in completing a Query, I will give a brief intoduction on the problem.
I have to calculate the date by using a parameter Status if the status is 1 then it has to fetch the value of the record created and the when the status is 1.
I have written a Query for this and is working fine, now I need to also include another status 2. i.e if the status is 1 then it has to fetch some records and if it is 2 then it will fetch different records.
Can you please suggest how do i use the option OR in SQL
vw_s_code.VALUE,(CASE when(new_vw_a.status_code =1 )
then floor(sysdate-(select entry_time from n_s_s nss
where status_code_pkid = 1 and nss.a_P = new_vw_s.PKID))
else floor(sysdate-new_vw_s.c_DATE)
END) Days_Since_Open,
I have tried using UNION its not working.
For the above I want to add option 2 i.e Status 1 or 2
Thanks in advance
Cheers
Can you please help in completing a Query, I will give a brief intoduction on the problem.
I have to calculate the date by using a parameter Status if the status is 1 then it has to fetch the value of the record created and the when the status is 1.
I have written a Query for this and is working fine, now I need to also include another status 2. i.e if the status is 1 then it has to fetch some records and if it is 2 then it will fetch different records.
Can you please suggest how do i use the option OR in SQL
vw_s_code.VALUE,(CASE when(new_vw_a.status_code =1 )
then floor(sysdate-(select entry_time from n_s_s nss
where status_code_pkid = 1 and nss.a_P = new_vw_s.PKID))
else floor(sysdate-new_vw_s.c_DATE)
END) Days_Since_Open,
I have tried using UNION its not working.
For the above I want to add option 2 i.e Status 1 or 2
Thanks in advance
Cheers