Hello -
I am trying to create an update statement to a table. I need to use a case statement or switch based on a date field.
Here is pseudo code for what I am trying to do:
Can someone help with the proper syntax or with the best way to accomplsh this?? Basically just trying to look at a date field in a record and update the period field.Code:update table1 set periodnumber = case mydate1 when 01/01/09 to 01/31/09 then 'Period1' when 02/01/09 to 02/31/09 then 'Period2' when 03/01/09 to 03/31/09 then 'Period2' etc...... end case
Thank you in advance.