HELP: Switch Command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a an unbound field in a report that utilizes the switch function. The
field is based on date entries in the report. I have been unable to set the
field to output the word "Unknown" if the date entry "is null"

here is the line I have in control source, how do I include the IS NULL
condition:
=switch([start date]>now(),"scheduled", [start date]<=now() and [end date]>=
now(),"attending",[end date]<now(),"ended")

I have tried to include: [start date] = is null, "unknown"
but this has not worked...
 
I would encapsulate this expression into a simple function rather than an
extended Switch() function. However you can use
IsNull([Start Date])
rather than
[start date] = is null
 
Try this (note use of IsNull function):

=switch([start date]>now(),"scheduled", [start date]<=now() and [end date]>=
now(),"attending",[end date]<now(),"ended", IsNull([start date])=True,
"unknown")
 
Back
Top