earliest date

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

Guest

I have a report that reurns a list of records and each record can have a
different date in the field [P2] I want to display a new date on the form
that is based on the ealiest date in the list of records
 
Do you mean you want the earliest date to display somewhere on the report?
You said "display a new date on the form" and I have no idea what form you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and set its
control source to =Min([P2]). That should be what you need.
 
Sorry, that was new date on the REPORT Not Form
I want to calculate a new date based on the earliest date in the list of
records.
I tried the min statement but it seems to work off the first date not the
earliest

John Spencer said:
Do you mean you want the earliest date to display somewhere on the report?
You said "display a new date on the form" and I have no idea what form you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and set its
control source to =Min([P2]). That should be what you need.


Paul LeBlanc said:
I have a report that reurns a list of records and each record can have a
different date in the field [P2] I want to display a new date on the form
that is based on the ealiest date in the list of records
 
John,
Do you mean you want the earliest date to display somewhere on the report?
You said "display a new date on the form" and I have no idea what form you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and set its
control source to =Min([P2]). That should be what you need.


Paul LeBlanc said:
I have a report that reurns a list of records and each record can have a
different date in the field [P2] I want to display a new date on the form
that is based on the ealiest date in the list of records
 
Make sure that you don't have a control named P2. If you do try changing
the name of the control to txtP2.

Now as far as the date. Do you want the earliest date in the table or the
earliest date in the query you are using for the report ?

Earliest date in the table would mean that you could use the DMin function.-
Check VBA Help for the complete syntax.
DMIN("P2","TheTableName")

If you are trying to do this based on the records for the report, then what
section has the control? Is it in the detail section, in the report header
or footer, in a group header or footer?

Paul LeBlanc said:
John,
Do you mean you want the earliest date to display somewhere on the
report?
You said "display a new date on the form" and I have no idea what form
you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and set
its
control source to =Min([P2]). That should be what you need.


Paul LeBlanc said:
I have a report that reurns a list of records and each record can have a
different date in the field [P2] I want to display a new date on the
form
that is based on the ealiest date in the list of records
 
John,
Here's the SQL query that supplies the data to the report
SELECT TblWhips.SERIES, TblWhips.CODE, VARIETY.NAME, TblWhips.PLOT,
TblWhips.DATEIN, TblWhips.WHIPSLOC, TblWhips.SEQ, TblWhips.BRDQTY,
TblWhips.BRDCURR, TblWhips.SCHEDP2, FIELD.FIELD
FROM (VARIETY INNER JOIN TblWhips ON VARIETY.ItemCode = TblWhips.CODE) INNER
JOIN FIELD ON TblWhips.RANGE = FIELD.RANGE
WHERE (((TblWhips.SERIES)=[What series?]) AND ((TblWhips.BRDQTY)>0))
ORDER BY TblWhips.WHIPSLOC, TblWhips.SEQ;
On the report detail all the data is displayed in columns under the page
header which has the corresponding field names.
I want to take the earliest instance of [SCHEDP2] and add 25 days to it and
have that displayed in the page footer or the report footer. It is always a
one page report
Here is what I tried after your last post
=Min(([SCHEDP2])+25) but what is displayed is #error
I have checked all the controls and none of them are named SCHEDP2

John Spencer said:
Make sure that you don't have a control named P2. If you do try changing
the name of the control to txtP2.

Now as far as the date. Do you want the earliest date in the table or the
earliest date in the query you are using for the report ?

Earliest date in the table would mean that you could use the DMin function.-
Check VBA Help for the complete syntax.
DMIN("P2","TheTableName")

If you are trying to do this based on the records for the report, then what
section has the control? Is it in the detail section, in the report header
or footer, in a group header or footer?

Paul LeBlanc said:
John,
Do you mean you want the earliest date to display somewhere on the
report?
You said "display a new date on the form" and I have no idea what form
you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and set
its
control source to =Min([P2]). That should be what you need.


I have a report that reurns a list of records and each record can have a
different date in the field [P2] I want to display a new date on the
form
that is based on the ealiest date in the list of records
 
Try the following

=DateAdd("d",25,Min([SCHEDP2]))


If that doesn't work, try just the following, just to see if this works.
=Min(SchedP2)

And you cannot do this in the PAGE footer. Do it in the report footer or in
a group footer.


Paul LeBlanc said:
John,
Here's the SQL query that supplies the data to the report
SELECT TblWhips.SERIES, TblWhips.CODE, VARIETY.NAME, TblWhips.PLOT,
TblWhips.DATEIN, TblWhips.WHIPSLOC, TblWhips.SEQ, TblWhips.BRDQTY,
TblWhips.BRDCURR, TblWhips.SCHEDP2, FIELD.FIELD
FROM (VARIETY INNER JOIN TblWhips ON VARIETY.ItemCode = TblWhips.CODE)
INNER
JOIN FIELD ON TblWhips.RANGE = FIELD.RANGE
WHERE (((TblWhips.SERIES)=[What series?]) AND ((TblWhips.BRDQTY)>0))
ORDER BY TblWhips.WHIPSLOC, TblWhips.SEQ;
On the report detail all the data is displayed in columns under the page
header which has the corresponding field names.
I want to take the earliest instance of [SCHEDP2] and add 25 days to it
and
have that displayed in the page footer or the report footer. It is always
a
one page report
Here is what I tried after your last post
=Min(([SCHEDP2])+25) but what is displayed is #error
I have checked all the controls and none of them are named SCHEDP2

John Spencer said:
Make sure that you don't have a control named P2. If you do try changing
the name of the control to txtP2.

Now as far as the date. Do you want the earliest date in the table or
the
earliest date in the query you are using for the report ?

Earliest date in the table would mean that you could use the DMin
function.-
Check VBA Help for the complete syntax.
DMIN("P2","TheTableName")

If you are trying to do this based on the records for the report, then
what
section has the control? Is it in the detail section, in the report
header
or footer, in a group header or footer?

Paul LeBlanc said:
John,
On your suggestion I tried it again =Min([P2]) and now I get an error
in
the textbox instead of the date, which should be 01/30/06

:

Do you mean you want the earliest date to display somewhere on the
report?
You said "display a new date on the form" and I have no idea what form
you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and
set
its
control source to =Min([P2]). That should be what you need.


message
I have a report that reurns a list of records and each record can
have a
different date in the field [P2] I want to display a new date on the
form
that is based on the ealiest date in the list of records
 
Thanks John,
Both of your suggestions worked as soon as I moved the control to the Report
Footer

John Spencer said:
Try the following

=DateAdd("d",25,Min([SCHEDP2]))


If that doesn't work, try just the following, just to see if this works.
=Min(SchedP2)

And you cannot do this in the PAGE footer. Do it in the report footer or in
a group footer.


Paul LeBlanc said:
John,
Here's the SQL query that supplies the data to the report
SELECT TblWhips.SERIES, TblWhips.CODE, VARIETY.NAME, TblWhips.PLOT,
TblWhips.DATEIN, TblWhips.WHIPSLOC, TblWhips.SEQ, TblWhips.BRDQTY,
TblWhips.BRDCURR, TblWhips.SCHEDP2, FIELD.FIELD
FROM (VARIETY INNER JOIN TblWhips ON VARIETY.ItemCode = TblWhips.CODE)
INNER
JOIN FIELD ON TblWhips.RANGE = FIELD.RANGE
WHERE (((TblWhips.SERIES)=[What series?]) AND ((TblWhips.BRDQTY)>0))
ORDER BY TblWhips.WHIPSLOC, TblWhips.SEQ;
On the report detail all the data is displayed in columns under the page
header which has the corresponding field names.
I want to take the earliest instance of [SCHEDP2] and add 25 days to it
and
have that displayed in the page footer or the report footer. It is always
a
one page report
Here is what I tried after your last post
=Min(([SCHEDP2])+25) but what is displayed is #error
I have checked all the controls and none of them are named SCHEDP2

John Spencer said:
Make sure that you don't have a control named P2. If you do try changing
the name of the control to txtP2.

Now as far as the date. Do you want the earliest date in the table or
the
earliest date in the query you are using for the report ?

Earliest date in the table would mean that you could use the DMin
function.-
Check VBA Help for the complete syntax.
DMIN("P2","TheTableName")

If you are trying to do this based on the records for the report, then
what
section has the control? Is it in the detail section, in the report
header
or footer, in a group header or footer?

John,
On your suggestion I tried it again =Min([P2]) and now I get an error
in
the textbox instead of the date, which should be 01/30/06

:

Do you mean you want the earliest date to display somewhere on the
report?
You said "display a new date on the form" and I have no idea what form
you
are talking about.

On a report, add a control to your report, name it txtEarlyDate and
set
its
control source to =Min([P2]). That should be what you need.


message
I have a report that reurns a list of records and each record can
have a
different date in the field [P2] I want to display a new date on the
form
that is based on the ealiest date in the list of records
 
Back
Top