Hi,
I have a bunch of queries that run on a table of tasks to split them out into:
a) Completed Tasks (task_completion_date field is not null)
b) Pending Tasks (task_due_date is greater than now() )
c) Overdue Tasks (task_due_date is less than now() )
What I would also like is a query that combines b) and c) above, so it shows all tasks that have not yet been completed, regardless of whether the task is overdue or not.
This in itself is easy of course, however I'd like an additional field entered at the end of the query which says 'Pending' or 'Overdue'.
In Excel, if would be something like:
if(task_due_date => now(),"Pending","Overdue")
If the task is not yet past the due date, then write "Pending", otherwise write "Overdue".
Is this possible with sql?
Many Thanks.
I have a bunch of queries that run on a table of tasks to split them out into:
a) Completed Tasks (task_completion_date field is not null)
b) Pending Tasks (task_due_date is greater than now() )
c) Overdue Tasks (task_due_date is less than now() )
What I would also like is a query that combines b) and c) above, so it shows all tasks that have not yet been completed, regardless of whether the task is overdue or not.
This in itself is easy of course, however I'd like an additional field entered at the end of the query which says 'Pending' or 'Overdue'.
In Excel, if would be something like:
if(task_due_date => now(),"Pending","Overdue")
If the task is not yet past the due date, then write "Pending", otherwise write "Overdue".
Is this possible with sql?
Many Thanks.