cdiwindows
MIS
I have a table with 3 columns Store/Date/Sales The table holds the "record Sales" for each store and the date they set the record. I have been asked to add to this table every time the store sets a new record. If a store beats their record another row is added to the table, not just overwritten.
Most of my time in SQL has been running reports, not updating the data, so this is kind of new to me.
Example of data
1050 12/07/2004 12:00:00 AM 13025.4
1060 02/14/2010 12:00:00 AM 12000
1061 11/12/2005 12:00:00 AM 32023.14
1062 02/14/2010 12:00:00 AM 37802.72
1092 02/14/2009 12:00:00 AM 25251.66
If store 1060 has sales of 12050.00 on 1/5/12 then 13234.44 on 1/18/2012 then the file would look like:
1050 12/07/2004 12:00:00 AM 13025.4
1060 02/14/2010 12:00:00 AM 12000
1060 01/05/2012 12:00:00 AM 12050
1060 01/18/2010 12:00:00 AM 13234.44
1061 11/12/2005 12:00:00 AM 32023.14
1062 02/14/2010 12:00:00 AM 37802.729999999996
1092 02/14/2009 12:00:00 AM 25251.66
I currently have a report that is run daily, sometimes multiple times, that I could include the update in but only update the record file if it does not already exist. Our Sales file that the original data comes from is replicated to our server from an outside vendor, so the sales report may be run multiple times to verify all the data is replicated to us before the report is published.
Thanks for your input.
Most of my time in SQL has been running reports, not updating the data, so this is kind of new to me.
Example of data
1050 12/07/2004 12:00:00 AM 13025.4
1060 02/14/2010 12:00:00 AM 12000
1061 11/12/2005 12:00:00 AM 32023.14
1062 02/14/2010 12:00:00 AM 37802.72
1092 02/14/2009 12:00:00 AM 25251.66
If store 1060 has sales of 12050.00 on 1/5/12 then 13234.44 on 1/18/2012 then the file would look like:
1050 12/07/2004 12:00:00 AM 13025.4
1060 02/14/2010 12:00:00 AM 12000
1060 01/05/2012 12:00:00 AM 12050
1060 01/18/2010 12:00:00 AM 13234.44
1061 11/12/2005 12:00:00 AM 32023.14
1062 02/14/2010 12:00:00 AM 37802.729999999996
1092 02/14/2009 12:00:00 AM 25251.66
I currently have a report that is run daily, sometimes multiple times, that I could include the update in but only update the record file if it does not already exist. Our Sales file that the original data comes from is replicated to our server from an outside vendor, so the sales report may be run multiple times to verify all the data is replicated to us before the report is published.
Thanks for your input.