Skip to content
Advertisement

Is it possible to use OR in a table link rather than AND

I have created a WorkFlowForm to allow logistical personal to combine multiple picknotes on one set of despatch paperwork. The WFF has all the header information and should pull through all the selected picknote items.

My issue is that in doing this on crystal, when linking the tables, it uses AND on the Join. The section of the report I’m referring to looks like this:

RIGHT OUTER JOIN "METROL_UK"."dbo"."UDEF_SO_PICKNOTE" "UDEF_SO_PICKNOTE" 
        ON  
((("TS_CUSTOM_LOGDOC"."LOGDOC2_PICKNOTENO"="UDEF_SO_PICKNOTE"."SPCK_NUMBER_STRING")         
AND ("TS_CUSTOM_LOGDOC"."LOGDOC2_PICKNOTENO2"="UDEF_SO_PICKNOTE"."SPCK_NUMBER_STRING"))         
AND ("TS_CUSTOM_LOGDOC"."LOGDOC2_PICKNOTENO3"="UDEF_SO_PICKNOTE"."SPCK_NUMBER_STRING"))         
AND ("TS_CUSTOM_LOGDOC"."LOGDOC2_PICKNOTENO4"="UDEF_SO_PICKNOTE"."SPCK_NUMBER_STRING")) 
ON "COR_TBL"."COR_UNIQUE"="UDEF_SO_PICKNOTE"."SPCK_COR_UNIQUE") 

I’ve tried changing the AND‘s in that statement to OR‘s and running the SQL, which gives me what I need. Is there anyway to replicate that on Crystal?

The table join in database expert looks like this – https://imgur.com/a/Xc3z6Wa

Advertisement

Answer

Create a command or a database view with the SQL that does work and use it as the data source for the report.

As a slower alternative (in terms of performance) you could remove the joins and use the OR conditions in Crystal’s record selection formula (Report, Selection Formula, Record…)

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement