Thursday, July 7, 2022

Plus Operator in SQL SERVER sum of two fields in SQL Query

Use single inverted commas to field


 CASE when ISNULL(NSQF_Reimburse_duration_in_hour,0)=0 or NSQF_Reimburse_duration_in_hour=NULL or NSQF_Reimburse_duration_in_hour='' THEN ('Theory_duration_in_hour' + 'PracticaL_duration_in_hour') 

WHEN ISNULL(('Theory_duration_in_hour' + 'PracticaL_duration_in_hour'),0)<ISNULL(NSQF_Reimburse_duration_in_hour,0) THEN ISNULL(('Theory_duration_in_hour' + 'PracticaL_duration_in_hour'),0)

WHEN ISNULL(('Theory_duration_in_hour' + 'PracticaL_duration_in_hour'),0)>ISNULL(NSQF_Reimburse_duration_in_hour,0) THEN ISNULL(NSQF_Reimburse_duration_in_hour,0)

WHEN ISNULL(('Theory_duration_in_hour' + 'PracticaL_duration_in_hour'),0)=ISNULL(NSQF_Reimburse_duration_in_hour,0) THEN ISNULL(NSQF_Reimburse_duration_in_hour,0) ELSE '' END 


No comments:

Post a Comment