As often happens, within minutes of posting the answer struck me. Use this expression:
iif(crectype="IDCard", cIdCard, cName)
>Hi,
>
>I am creating a report listing possible duplicate customers. I gather the data and flag a duplicate as being either "IDCard" or "Name" depending on if the duplication is due to the ID Card or Name. All possible duplicate records are added to a cursor and the cRecType field is filled in with either "IDCard" or "Name".
>
>When I produce my report, I want a grouping on my cIDCard field if the cRecType is "IDCard" and if not I want the group on my cName field.
>
>I tried a grouping on this expression iif(crectype="IDCard", "cIdCard", "cName") but this isn't working, I'm not getting a break on each idcard or name.
>
>Any ideas how I can achieve this?
>
>Thanks,