Crystal Reports选择语句帮助

时间:2010-12-06 22:41:06

标签: crystal-reports crystal-reports-8.5

我正在尝试添加MV_AgeBased和MV_FeeInLieu列,但是db中的某些列可能为null或为空,这会导致为该CodeEntity带回零。有什么建议吗?

        SELECT "AuditorYearEnd"."PP_MH_Pri", "AuditorYearEnd"."PP_MH_Other", 
"County"."Name", "AuditorYearEnd"."TOTAL_Personal_calc", 
"AuditorYearEnd"."PP_BusPersonal", "AuditorYearEnd"."TaxYr", 
"AuditorYearEnd"."CodeEntity", "AuditorYearEnd"."MV_AgeBased", 
"AuditorYearEnd"."MV_FeeInLieu"
     FROM   "txctr"."dbo"."AuditorYearEnd" "AuditorYearEnd" 
INNER JOIN "txctr"."dbo"."County" "County" ON "AuditorYearEnd"."CodeCounty"="County"."CodeCounty"
     WHERE  "AuditorYearEnd"."TaxYr"=2010 AND "AuditorYearEnd"."CodeEntity"='1010'

1 个答案:

答案 0 :(得分:0)

    SELECT "AuditorYearEnd"."PP_MH_Pri", "AuditorYearEnd"."PP_MH_Other", 
"County"."Name", "AuditorYearEnd"."TOTAL_Personal_calc", 
"AuditorYearEnd"."PP_BusPersonal", "AuditorYearEnd"."TaxYr", 
"AuditorYearEnd"."CodeEntity", "AuditorYearEnd"."MV_AgeBased", 
"AuditorYearEnd"."MV_FeeInLieu"
 FROM   ("txctr"."dbo"."AuditorYearEnd" "AuditorYearEnd" 
INNER JOIN "txctr"."dbo"."County" "County" ON "AuditorYearEnd"."CodeCounty"="County"."CodeCounty"
 WHERE  "AuditorYearEnd"."TaxYr"=2010 AND "AuditorYearEnd"."CodeEntity"='1010')

为所有可能为空的列添加“WHERE [column] not null”?

不完全确定这里有什么问题。