I and creating view in SQL Server
Below is my Results , based on this I have to actually achieved the results shown below in the second table
PersonID MonthYear DateTimevalue
---------- ---------- --------------
1 201101 NULL
1 201102 NULL
1 201103 2011-03-10 09:35:57.387
1 201104 2011-04-26 13:25:00.050
1 201105 NULL
1 201106 NULL
1 201107 2011-07-30 16:49:26.050
1 201108 NULL
1 201109 2011-09-21 13:33:42.273
1 201110 2011-10-20 08:55:59.873
1 201111 NULL
1 201112 NULL
So , the case when the DateTimeValue is NULL , we need to take the value from previous month
As shown in the below table
PersonID MonthYear DateTimevalue
---------- ---------- --------------
1 201101 NULL
1 201102 NULL
1 201103 2011-03-10 09:35:57.387
1 201104 2011-04-26 13:25:00.050
1 201105 2011-04-26 13:25:00.050
1 201106 2011-04-26 13:25:00.050
1 201107 2011-07-30 16:49:26.050
1 201108 2011-07-30 16:49:26.050
1 201109 2011-09-21 13:33:42.273
1 201110 2011-10-20 08:55:59.873
1 201111 2011-10-20 08:55:59.873
1 201112 2011-10-20 08:55:59.873
Any help would be great !!!!
Thanks !!!!
Thanks !!!