Min, Max Alternative

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

Guest

I have a report that is calling the first and last dates from a registration
list. This works well if there is only two dates in the list as originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
I currently have the query that is returning the 3 dates and using the DMax
and DMin but not sure how to access the 2nd date in the list of three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup maybe?

Any suggestions?

Alex Dybenko said:
Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

Zanstemic said:
I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
Hi,
then you can make a query:

Select top 2 [date scheduled] from MyTable Order by [date scheduled]

and get DLast of it - this will be a 2nd date

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Zanstemic said:
I currently have the query that is returning the 3 dates and using the DMax
and DMin but not sure how to access the 2nd date in the list of three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup maybe?

Any suggestions?

Alex Dybenko said:
Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

Zanstemic said:
I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as
originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
Thank you for your patience.

Alex Dybenko said:
Hi,
then you can make a query:

Select top 2 [date scheduled] from MyTable Order by [date scheduled]

and get DLast of it - this will be a 2nd date

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Zanstemic said:
I currently have the query that is returning the 3 dates and using the DMax
and DMin but not sure how to access the 2nd date in the list of three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup maybe?

Any suggestions?

Alex Dybenko said:
Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as
originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
I'm closing in on it but having trouble with the syntax. I'm relatively new
to SQL.

is Select top 2 [date scheduled] normal syntax?

Any guidance is appreciated.

Alex Dybenko said:
Hi,
then you can make a query:

Select top 2 [date scheduled] from MyTable Order by [date scheduled]

and get DLast of it - this will be a 2nd date

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Zanstemic said:
I currently have the query that is returning the 3 dates and using the DMax
and DMin but not sure how to access the 2nd date in the list of three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup maybe?

Any suggestions?

Alex Dybenko said:
Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as
originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
Thanks Alex, the syntax is correct.

In the report generator, I have a text box that is

="this is the first date" & Min[date scheduled] & "this is the second date"
& Max[date scheduled]

I'm not sure where to place the SQL statement to setup for the Min and Max.
The above ends up in the control source.

Any suggestions approaching running SQL statements to create a paragraph of
text?

Zanstemic said:
I'm closing in on it but having trouble with the syntax. I'm relatively new
to SQL.

is Select top 2 [date scheduled] normal syntax?

Any guidance is appreciated.

Alex Dybenko said:
Hi,
then you can make a query:

Select top 2 [date scheduled] from MyTable Order by [date scheduled]

and get DLast of it - this will be a 2nd date

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Zanstemic said:
I currently have the query that is returning the 3 dates and using the DMax
and DMin but not sure how to access the 2nd date in the list of three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup maybe?

Any suggestions?

:

Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as
originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " & Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
Hi,
in this case you can use DMin() and DMax() functions like:

="this is the first date" & DMin("[date scheduled]","MyTable")

other option - is to put VBA code in report section format event. this will
require more coding, but you will have better control over it

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Zanstemic said:
Thanks Alex, the syntax is correct.

In the report generator, I have a text box that is

="this is the first date" & Min[date scheduled] & "this is the second
date"
& Max[date scheduled]

I'm not sure where to place the SQL statement to setup for the Min and
Max.
The above ends up in the control source.

Any suggestions approaching running SQL statements to create a paragraph
of
text?

Zanstemic said:
I'm closing in on it but having trouble with the syntax. I'm relatively
new
to SQL.

is Select top 2 [date scheduled] normal syntax?

Any guidance is appreciated.

Alex Dybenko said:
Hi,
then you can make a query:

Select top 2 [date scheduled] from MyTable Order by [date scheduled]

and get DLast of it - this will be a 2nd date

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


I currently have the query that is returning the 3 dates and using the
DMax
and DMin but not sure how to access the 2nd date in the list of
three.

DMin, Dmax, DLast seem to give the first and last dates. DLookup
maybe?

Any suggestions?

:

Hi,
you can make a new query with returns top 3 dates, like:

Select top 3 [date scheduled] from MyTable Order by [date scheduled]

and then get Max() (or DMax(), or DLast()) of it, so you get a 3rd
date)

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

I have a report that is calling the first and last dates from a
registration
list. This works well if there is only two dates in the list as
originally
specified.

Format(Min([date scheduled]),"Long Date") & " and " &
Format(Max([date
scheduled]),"Long Date")

Any suggestions on how to list a 3rd or 4th date?

[date scheduled], [date scheduled], [date scheduled]
 
Back
Top