B
Bruce
There are two questions here.
I am using Between [Start Date] And [End Date] as a
reprot's parameters. I can get that to print in mmm d,
yyyy format on the report by adding to an unbound text
box: =Format([Start Date],"mmm d"", ""yyyy") & " to " &
Format([End Date],"mmm d"", ""yyyy"). However, one of the
parameter options is to leave the dates blank in order to
return all records. In that case I would like to come up
with the earliest date for which there is a record and the
current date. For instance, if the earliest record is
6/6/03, I would like the report to read "Jun 6, 2003 to
(current date)". The current date is no problem, but the
earliest date has me stumped. Also, I would like the use
to be able to enter a start date, and have the end date be
the current date if the user leaves it blank. Again, this
would be printed on the report.
My experiments so far have shown me that I cannot figure
out how to set conditions, which would be something like:
If((Start Date and End Date are blank),(earliest date) & "
to " & (current date),If((Start Date) contains a value and
(End Date) is blank,(start date) & " to " & (current date),
(start date) & " to " & (end date)). I expect this would
be IIf rather than If (assuming I am even in the right
neighborhood with this approach), but I cannot get it to
work.
Second question. I would like another text box on the
same report to contain a concatenated value: [PartNum1]
& ", " & [PartNum2]...etc. for four part numbers. The
trouble is that if there is only one part number, I still
get the commas. I can sort of imagine nested IIf
statements in an unbound text box: = IIf ([PartNum1]
= "" , "", IIf (([PartNum1]<>"" And [PartNum2]=""),
[PartNum1], IIf (([PartNum1<>"" And [PartNum2]<>""),
[PartNum1] & ", " & [PartNum2], etc. but for one thing I'm
not sure if it would work, for another I don't know if I
need all of those And statements, and for another I am
hoping there is a better way.
Spaces in all expressions in this posting were added for
ease of reading.
I am using Between [Start Date] And [End Date] as a
reprot's parameters. I can get that to print in mmm d,
yyyy format on the report by adding to an unbound text
box: =Format([Start Date],"mmm d"", ""yyyy") & " to " &
Format([End Date],"mmm d"", ""yyyy"). However, one of the
parameter options is to leave the dates blank in order to
return all records. In that case I would like to come up
with the earliest date for which there is a record and the
current date. For instance, if the earliest record is
6/6/03, I would like the report to read "Jun 6, 2003 to
(current date)". The current date is no problem, but the
earliest date has me stumped. Also, I would like the use
to be able to enter a start date, and have the end date be
the current date if the user leaves it blank. Again, this
would be printed on the report.
My experiments so far have shown me that I cannot figure
out how to set conditions, which would be something like:
If((Start Date and End Date are blank),(earliest date) & "
to " & (current date),If((Start Date) contains a value and
(End Date) is blank,(start date) & " to " & (current date),
(start date) & " to " & (end date)). I expect this would
be IIf rather than If (assuming I am even in the right
neighborhood with this approach), but I cannot get it to
work.
Second question. I would like another text box on the
same report to contain a concatenated value: [PartNum1]
& ", " & [PartNum2]...etc. for four part numbers. The
trouble is that if there is only one part number, I still
get the commas. I can sort of imagine nested IIf
statements in an unbound text box: = IIf ([PartNum1]
= "" , "", IIf (([PartNum1]<>"" And [PartNum2]=""),
[PartNum1], IIf (([PartNum1<>"" And [PartNum2]<>""),
[PartNum1] & ", " & [PartNum2], etc. but for one thing I'm
not sure if it would work, for another I don't know if I
need all of those And statements, and for another I am
hoping there is a better way.
Spaces in all expressions in this posting were added for
ease of reading.