Table1
OrderNumber Item Date
1 Bat 1/1/2021
2 Ball 1/2/2021
3 Wickets
Table2
OrderNumber Item Date
1 Bat 1/1/2021
2 Ball 1/2/2021
3 Wickets 1/3/2021
Table3
OrderNumber Item Date
1 Bat 1/1/2021
2 Ball 1/2/2021
3 Wickets 1/3/2021
I have two tables Table1 and Table 2, I want to insert data into Table 3 from Table 1 and Table 2
DataType of Date
Table 1 datatime
Table 2 date
Table 3 datetime
Insert into Table3(OrderNumber, Item, Date)
Select
OrderNumber,
Item,
(If Date is null in Table1
Then Select Date from Table2)
From
Table 1