Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
SELECT TWCI_Job_Code,TWCI_Warehouse_code,SUM((TWCI_Quantity)) from SQLSCM.SCM_T_Warehouse_Cumulative_Issues
                                           where TWCI_Job_Code='mbbh7533' and TWCI_Warehouse_code=2668 and TWCI_Material_Code='109931300' and
                                           TWCI_Stock_Type_Code=4 and TWCI_Stock_Type_Detail_Code=11 and TWCI_Company_code=1 and
                                            TWCI_Start_Date>='2015-04-01' and TWCI_End_Date<='2015-04-28'
                                            GROUP BY TWCI_Job_Code,TWCI_Warehouse_code
Posted
Comments
Mehdi Gholam 14-May-15 0:58am    
If a column is null then you will get null, what is your specific problem?
manoswc 14-May-15 4:37am    
there is no column for the particular date specified in this scenario I want null inspite of getting nothing

1 solution

you'll have to do an EXISTS()[^] check, and of you get nothing, specifically return nulls
select NULL as TWCI_Job_Code, NULL as TWCI_Warehouse_code
 
Share this answer
 
Comments
manoswc 14-May-15 4:38am    
I am inserting it in another table this wil work out? using insert into tablename select from

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900