Hi All,
I have a table which have 10 columns. I have to insert data for that table. I have some insert statements. first insert statement insert data for first 3 rows from one source. Now I want to insert data for next columns in same row using another insert statements from different source.
These insert queries runs daily for table Order_Warehouse_Status, so we will have 1 row for daily transaction.
Ex. Table Order_Warehouse_Status have 10 columns like Printed_PPS_Shipment,Printed_Shipment_Lines,Printed_Unit, Picking_Scheduled_Orders, Picking_Scheduled_Lines, Picking_Scheduled_Units, Pick_Complete_Orders, Pick_Complete_Lines, Pick_Complete_Units. below 1st query insert data in first 3 columns. 2nd query should insert data for next column in same row. How to achieve this?
--1st Query
insert into Order_Warehouse_Status (Date, Printed_PPS_Shipment,Printed_Shipment_Lines,Printed_Unit) SELECT Getdate(),count(v_c_ship_ship_id) as Printed_PPS_Shipment, count(ship_l_id) as Printed_Shipment_Lines, count(allocated_qty) as Printed_Unit FROM [STG_WMS_Status_PPS_Line_QTY] where CONVERT(DATE,Inserted_date )=CONVERT(DATE,Getdate()) and shipment_status=2
--2nd query
insert into Order_Warehouse_Status (Date, Picking_Scheduled_Orders, Picking_Scheduled_Lines, Picking_Scheduled_Units) SELECT Getdate(), count(v_c_ship_ship_id) as Picking_Scheduled_Orders, count(ship_l_id) as Picking_Scheduled_Lines, count(allocated_qty) as Picking_Scheduled_Units FROM [STG_Closed_Received] where CONVERT(DATE,Inserted_date )=CONVERT(DATE,Getdate()) and shipment_status=7
Thanks in advance