B
brigid
The user inputs a start date and an end date in a form,
and the query displays data in between those 2 dates. If
the user enters a start date but no end date, by default
the end date = start date and therefore that day's data
is displayed. If the user enters an end date but no
start date, by default the start date = today's date, and
therefore data for today's date through the end date is
displayed. However, if the user leaves both dates blank,
I would like both dates to default to today's date.
However, no data whatsoever is being displayed. I don't
understand why because the start date should be defaulted
to today's, and when the end date is null it looks to the
start date. The code is as follows:
SELECT [calculated dates].calculatedFromDate, [calculated
dates].calculatedToDate, [calculated dates].[Blotter
Entry Date]
FROM [calculated dates]
WHERE ((([calculated dates].calculatedFromDate)>=IIf
([Forms]![range]![start] Is Null,Date(),[Forms]![range]!
[start]) And ([calculated dates].calculatedFromDate)<=IIf
([Forms]![range]![end] Is Null,[Forms]![range]![start],
[Forms]![range]![end])) AND (([calculated
dates].calculatedToDate)>=IIf([Forms]![range]![start] Is
Null,Date(),[Forms]![range]![start]) And ([calculated
dates].calculatedToDate)<=IIf([Forms]![range]![end] Is
Null,[Forms]![range]![start],[Forms]![range]![end])));
and the query displays data in between those 2 dates. If
the user enters a start date but no end date, by default
the end date = start date and therefore that day's data
is displayed. If the user enters an end date but no
start date, by default the start date = today's date, and
therefore data for today's date through the end date is
displayed. However, if the user leaves both dates blank,
I would like both dates to default to today's date.
However, no data whatsoever is being displayed. I don't
understand why because the start date should be defaulted
to today's, and when the end date is null it looks to the
start date. The code is as follows:
SELECT [calculated dates].calculatedFromDate, [calculated
dates].calculatedToDate, [calculated dates].[Blotter
Entry Date]
FROM [calculated dates]
WHERE ((([calculated dates].calculatedFromDate)>=IIf
([Forms]![range]![start] Is Null,Date(),[Forms]![range]!
[start]) And ([calculated dates].calculatedFromDate)<=IIf
([Forms]![range]![end] Is Null,[Forms]![range]![start],
[Forms]![range]![end])) AND (([calculated
dates].calculatedToDate)>=IIf([Forms]![range]![start] Is
Null,Date(),[Forms]![range]![start]) And ([calculated
dates].calculatedToDate)<=IIf([Forms]![range]![end] Is
Null,[Forms]![range]![start],[Forms]![range]![end])));