Select TM.Order_code , TI.Order_NUMBER From OrderCheck TM
Inner join OrderTable TI
ON TM.OrderCode = TI.OrderCode
Where OrderDate = @L_INV_DATE
PRINT 'NULL VALUE'
ELSE
PRINT 'NOT NULL'
In the above code i have write the query as per below steps but not giving the proper result , pls sort me out from this problem as the steps to create the above query as mentioned below
Select all the Order codes(order_code ) from OrderCode table
For each Order code, select the Order Number and Date from Order Master table ( OrderTable ) for all the Orders where date is same as parameter date
If there are no order for a particular Order_code, select the next Order_code from the OrderCode table and start again from step 1. Otherwise, insert the Date and Order code in the New table OrderDetail table
Here the OrderDetail table have some column ...
Go to the complete details ...