Avatar of Gordon Hughes
Gordon Hughes
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Help with formula

What is wrong with this?
if ({@DBSCheck}) = 'No' then 'NA' else ({MembersDetails.DBS Expiry Date})

it says a string is required after else
Crystal Reports

Avatar of undefined
Last Comment
Gordon Hughes

8/22/2022 - Mon
Raghavendra Hullur

Hi,

Your else condition seems to be returning a date data type as the field suggests.
You need to typecast the date to a string using cStr({MembersDetails.DBS Expiry Date}) or cStr({MembersDetails.DBS Expiry Date}, <required date format for e.g MM/dd/yyyy>)

Hope that helps.
Gordon Hughes

ASKER
Hi
I have modified the formula to
if ({@DBSCheck}) = 'No' then 'NA' else cStr({MembersDetails.DBS Expiry Date})

It partially works
what do I need to add to only see dd/mm/yyy  not any hours

Gordon
ASKER CERTIFIED SOLUTION
Raghavendra Hullur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Gordon Hughes

ASKER
Thanks all working great
Gordon
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck