Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cmrrive
Starting Member
6 Posts |
Posted - 2012-03-25 : 10:23:40
|
My table looks like thisBus,GLAcct,Amount,Date 1,410100, 200,2012-01-01 2,410100, 250,2012-01-02 3,410100, 300,2012-01-04I need to add (missing date 2012-01-03) and keep the samedate for previous record (2,410100,250,2012-01-02). This will apply for any missing date on the table.Any help please!!!miguel |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2012-03-25 : 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 ShawSQL Server MVP |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|