Help with formula

Gordon Hughes
Gordon Hughes used Ask the Experts™
on
What is wrong with this?
if ({@DBSCheck}) = 'No' then 'NA' else ({MembersDetails.DBS Expiry Date})

it says a string is required after else
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
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 HughesDirector

Author

Commented:
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
Commented:
Use this:

if ({@DBSCheck}) = 'No' then 'NA' else cStr({MembersDetails.DBS Expiry Date}, 'dd/MM/yyyy')
Gordon HughesDirector

Author

Commented:
Thanks all working great
Gordon

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial