I need to subtract 5 hours if the datetime falls before 03/09/2014
saving and 4 hours if it's after 03/09/2014
. It's in a case statement this is what I have so far but it's only hitting the first when and not working with the second when.
max(
Case
when aa.status_id=10 and aa.created_at <'3/09/2014'
then DATE_SUB(aa.created_at, interval 4 HOUR)
when aa.status_id=10 and aa.created_at >'3/09/2014'
then DATE_SUB(aa.created_at, interval 4 HOUR)
else null
end )as form_Receieved