|
cmrrive
Starting Member
USA
6 Posts |
Posted - 03/25/2012 : 10:23:40
|
My table looks like this
Bus,GLAcct,Amount,Date 1,410100, 200,2012-01-01 2,410100, 250,2012-01-02 3,410100, 300,2012-01-04
I need to add (missing date 2012-01-03) and keep the same date for previous record (2,410100,250,2012-01-02). This will apply for any missing date on the table.
Any help please!!!
miguel |
|
|
GilaMonster
Flowing Fount of Yak Knowledge
South Africa
4507 Posts |
Posted - 03/25/2012 : 12:05:22
|
You need a calendar table for this, a table that just contains sequential dates from a starting date to an ending date. Once you have that, it's a simple left join or not exists to find the dates that don't exists in your table.
-- Gail Shaw SQL Server MVP |
 |
|