Days Between Start date/today, unless Date finished. [message #616412] |
Mon, 16 June 2014 12:19 |
|
william.wright
Messages: 1 Registered: June 2014 Location: Hillsboro, Or
|
Junior Member |
|
|
Hello all,
Im new to the Site, and new to PL/SQL. Didn't even know what it was til 6 months ago. Anyways. Ive ben trying to research it for a month now and ive giving up. What i need to do it. Within my App on a report column, i need it to display is an pl/sql function? or Expression?
what i need the help with is the query
where
Days between "DATE_RECIEVED" and "EST_FINISH_DATE" if null, then current date.
I would really appreciate the help.
Please and thank you!
|
|
|
Re: Days Between Start date/today, unless Date finished. [message #616413 is a reply to message #616412] |
Mon, 16 June 2014 12:23 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
william.wright wrote on Mon, 16 June 2014 22:49
where
Days between "DATE_RECIEVED" and "EST_FINISH_DATE" if null, then current date.
Firstly, always remember to mention the DB version.
Seems you want to select the rows based on the between date condition, and that if you get NULL value you want to have the SYSDATE instead. If yes, then, read the documentation for NVL function. And come back with what you tried. And post the complete query to understand what exactly you are trying to do.
edit : provided link to docs
[Updated on: Mon, 16 June 2014 12:32] Report message to a moderator
|
|
|
Re: Days Between Start date/today, unless Date finished. [message #616439 is a reply to message #616413] |
Tue, 17 June 2014 00:17 |
|
Littlefoot
Messages: 21807 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I agree with Lalit, that would be the NVL function you'd use in the WHERE clause.
However, as it is an Apex question, I can't really imagine what the following means:
WW
Within my App on a report column, i need it to display is an pl/sql function? or Expression?
- "on a report column": you select report columns from a query; what is "on" here for?
- "I need it to display": what is "it"? A report itself? Something different?
- "is an pl/sql function? or Expression?": that's what puzzles me the most. Report columns don't have any functions nor expressions. I really can't imagine what you are talking about here.
The way I understand it, you'd like to select "something" different from a column that belongs to a table, and wonder whether it is a PL/SQL function or an "expression". This is an example:
select
ename, --> a column that belongs to the EMPLOYEES table
f_emp_age(empno) emp_age, --> a (PL/SQL) function that calculates someone's age
case when emp_sex = 'M' then 'male' --> an expression that determines someone's sex
when emp_sex = 'F' then 'female'
else 'unknown'
end sex
from employees
I'm not sure that this is what you asked so - if you could explain what I asked, clear my (and, possibly, someone else's) doubts, perhaps we could suggest something you could use in your application.
|
|
|