jeudi 7 mai 2015

Crystal Reports multiple variable formula

I have multiple criteria I would like to place within a formula (using CR v11). Not sure if 'If Then Else' logic is most appropriate here, but have not seen Case statements or much else that applies. There are 8 different catergories, as shown below, but each will have 3 parts to it. Would like to have all-in-one formula to use, but if need be can break into 8. So far, the formula does not seem to want to read beyond the first If/Then (FHLMC) clause. Might be missing set of paren or something. Also had issues using a 'not null'. Any suggestions?

if (not isnull({Usr_Claims.FHLMCFileDate})) and ({Usr_Claims.FHLMCPaidAmt} = 0) and (CurrentDate - {Usr_Claims.FHLMCFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.FNMAFileDate})) and ({Usr_Claims.FNMAPaidAmt} = 0) and (CurrentDate - {Usr_Claims.FNMAFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.FHAFileDate})) and ({Usr_Claims.FHAPaidAmt} = 0) and (CurrentDate - {Usr_Claims.FHAFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.VAFileDate})) and ({Usr_Claims.VAPaidAmt} = 0) and (CurrentDate - {Usr_Claims.VAFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.USDAFileDate})) and ({Usr_Claims.USDAPaidAmt} = 0) and (CurrentDate - {Usr_Claims.USDAFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.PMIFileDate})) and ({Usr_Claims.PMIPaidAmt} = 0) and (CurrentDate - {Usr_Claims.PMIFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.SuppFileDate})) and ({Usr_Claims.SuppPaidAmt} = 0) and (CurrentDate - {Usr_Claims.SuppFileDate} >60) then 'Claim Outstanding over 60 days!' else if (not isnull({Usr_Claims.FHLBFileDate})) and ({Usr_Claims.FHLBPaidAmt} = 0) and (CurrentDate - {Usr_Claims.FHLBFileDate} >60) then 'Claim Outstanding over 60 days!' else 'Fine'

Aucun commentaire:

Enregistrer un commentaire