October 24th, 2012, 06:01 AM
Calculations within a view
Im not sure if this is possible. I want to create a view, but i want the view to include a calculation based on dates, it needs to take a date, check if that date has pasts todays date, if it has i would like a column to indicate 'Overdue'. So for instance, a task is due 31/09/2012 so with todays date being 24/10/2012, this task is now overdue, i would like a column in my view to indicate that this task is overdue.
Any assistance would be greatly appreciated.
October 24th, 2012, 06:43 AM
assuming that the name of the date column is dueDate.
select case when dueDate < current_date then 'Overdue' end ...
October 24th, 2012, 07:58 AM
Thanks swampBoogie, works perfectly.