Avatar of SweetingA
SweetingA

asked on 

Upadte SQL table based on records in another table

In SQL server 2008 express.

I need to lookup each instance of startdate from tbl1 in tbl2 and insert the downtime code from tabl1 into tbl2 only where the downtime in tbl2 is not null.

tbl_1

ID     StartDate      StopDate       StopTime    DowntimeCode

1       2014-01-01   2014-01-02         24                     3
2       2014-01-02   2014-01-03         31                     6
3


tbl_2

ID     StartDate      StopDate       StopTime    DowntimeCode
         2014-01-01                                                          3
         2014-01-01                                                          3
         2014-01-02                                                          6

Thankyou very much for your assistance.
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
David Todd

8/22/2022 - Mon