I have a table called tblCPI that holds approximately 160,000 records that have to do with Canadian CPI. I have created a process that did the initial data load into it and now I need help figuring out how to update it according to date values. For instance, say we have a date range in the table from Jan 2005 to Aug 2012. Now there is an update from our source and I'll need to update the records from Jan 2005 to the Sep 2012.
I know that updating pre-existing records like this is not generally accepted but Stats Canada revises a lot of historical records on their end so I have to do the same on my end. I was thinking that using dates as comparators would be the way to go but my skills (so far) are lacking with regards to writing SQL statements and I don't know how to write:
If srcDate = dbo.tblCPI.Variable_Date then update dbo.tblCPI.Variable_Value Else do nothing.
Any guidance would be very much appreciated.