Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

[ACCESS][SOLVED] Date format, N/A for Null or blank for hand written date?

  • 03-08-2017 08:30AM
    #1
    Registered Users, Registered Users 2 Posts: 1,929 ✭✭✭


    I'm looking for solution that allows to have a field in report to show:
    1. Normal date, format dd-mmm-yyyy (DONE)
    2. N/A when the date is Null (DONE with dd-mmm-yyyy;;;"N/A"
    3. Now the tricky part: I want to be able to leave the field blank for hand written date.

    Any simple ideas about how to do it? I'm going to play with an additional field DATE_VISIBLE that would control visibility of the date field, but it feels like a hack - is there a better method?


Comments

  • Registered Users, Registered Users 2 Posts: 1,929 ✭✭✭PrzemoF


    Additional field DATE_VISIBLE and Iif([DATE_VISIBLE], my-date-field-here, "") in SQL quary allows to handle all 3 cases.


    Edit: It's half-solved; using IIf breaks date formatting :-/

    Finally solved with ugly nested iif:
    CLIENT_DATE: Format(IIf([DATE_VISIBLE],IIf([CLIENT_APPROVAL_DATE],[CLIENT_APPROVAL_DATE],"N/A")),"dd-mmm-yyyy")
    


Advertisement