0

I am trying to use the below to determine a warranty status Always comes up inactive...

case 'Status'
   when current_date between  w.start_date and  w.end_date then 'Active'       
   else 'Inactive'
end

Tried this per recommendation:

  case 'Status'
   when date('now') between  w.start_date and w.end_date then 'Active' 
   else 'Inactive'

end as status

still nothing.. looking at the data in the db and format is YYYY-MM-DD

Even tried wrapping the columns in date() format..

This shouldn't be brain surgery...

enter image description here

I do notice that when I export the results to excel the warranty dates are formatted with / and the current date is not...

anyone have any clues?

4

1 回答 1

0

使用日期功能,试试这个(我不确定你为什么'Status'在你的案例陈述中使用)

case 
    when date('now') between  w.start_date and w.end_date then 'Active'       
    else 'Inactive'
end
于 2013-05-22T18:18:54.613 回答