I need some help with the logic on how to update a date field based on information in another date field in MS SQL 2008.
DATE1: YYYY-MM-DD-hh:mm – This field is populated with a data entered by the client with all elements entered
DATE2: Same format. However, I want to create this datestamp using the YYYY and MM from DATE1 and setting DD to 01, hh:mm to 00:00.
I need to do this for the whole table, with each record having a unique ID with a (hopefully) simple SQL script.
Both fields currently exist in the database – I just need to update the DATE2 field based on pieces of the DATE1 field.
Thanks for any and all help that can be provided!