I have been able to get the following sql to work - "select if(month(policydate)<=6),month(policydate),month(policydate)-6) as mth from mytable". I would like to be able to do the following
"select if(month(now()<6,(if(month(policydate)>6 ,month(policydate)-6,month(policydate))),
(if(month(policydate)<=6 ,month(policydate)+6,month(policydate))) as mth from mytable". Anyone been able to get similar syntax to work with mysql?
"select if(month(now()<6,(if(month(policydate)>6 ,month(policydate)-6,month(policydate))),
(if(month(policydate)<=6 ,month(policydate)+6,month(policydate))) as mth from mytable". Anyone been able to get similar syntax to work with mysql?