Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> DECODE Using a Date Comparison? Any ideas?
Hi,
I'm wanting to create a view that has in it a flag that determines whether a user in my mailing list application is currently suspended. The user can select to be suspended from receiving mail, at which point, values are entered to two fields in their user record:-
NUMSUSPENDDURATION: number of days until sending should resume DATESUSPENDSTART: the date that they requested the suspension to start at
What I would like to do is have a calculated field in the view that will show a 1 if the user is under suspension (ie. both NUMSUSPENDDURATION and DATESUSPENDSTART are set, and that those two fields added together are greater than SysDate). I tried a DECODE that looked like this, but it doesn't work:-
DECODE(((TO_DATE(datesuspendstart+numsuspendduration))>SYSDATE),1,0,0)
Any ideas?
Thanks in advance,
Mark Tortolano Received on Thu Jul 30 1998 - 10:14:48 CDT
![]() |
![]() |