Date range

  • Thread starter lmcc via AccessMonster.com
  • Start date
L

lmcc via AccessMonster.com

I have a Date field for each event in my table. Each company will have a
range if they have more than one event--e.g., 7/7/90 - 1/5/94.

How do I ask for the first event date and the last event date, so my header
would read 7/7/90 - 1/5/94.

How would I go about doing this? I can't think of anything at the moment?

Any quick answers?

Thanks!
 
N

NevilleT

Hi
If I understand what you want it is to filter a form or report to only show
a selectable date range.

Set up a form with the two date fields. Create a query that uses those
fields as parameters. If the form was called frmForm and the fields txtStart
and txtEnd, the query would include parameter >Forms!frmForm!frmStart and
<Forms!frmForm!frmEnd. You can use the expression builder to get the right
syntax.

To display the information on the report, create a textbox and put a formula
in the controlsource. Something like
="Between " & Format(Forms!frmForm!txtStart,"Short Date") & " and " &
Format(Forms!frmForm!txtEnd,"Short Date")

Hope that was what you were looking for.

Neville Turbit
www.projectperfect.com.au
 
J

John Spencer

Don't completely understand the question. You mention Header so I can guess
you are talking about a report (or a form).

Which header are you talking about? The Report Header, the page header, or a
group header?

Generally you can use a textbox with its control source set to
=Min([EventDate]) 'To get the earliest event date for the section of the report
=Max([EventDate]) 'To get the latest event date for the section of the report.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
L

lmcc via AccessMonster.com

No, I am looking for the first date and last date of a chronilogical list.
Hi
If I understand what you want it is to filter a form or report to only show
a selectable date range.

Set up a form with the two date fields. Create a query that uses those
fields as parameters. If the form was called frmForm and the fields txtStart
and txtEnd, the query would include parameter >Forms!frmForm!frmStart and
<Forms!frmForm!frmEnd. You can use the expression builder to get the right
syntax.

To display the information on the report, create a textbox and put a formula
in the controlsource. Something like
="Between " & Format(Forms!frmForm!txtStart,"Short Date") & " and " &
Format(Forms!frmForm!txtEnd,"Short Date")

Hope that was what you were looking for.

Neville Turbit
www.projectperfect.com.au
I have a Date field for each event in my table. Each company will have a
range if they have more than one event--e.g., 7/7/90 - 1/5/94.
[quoted text clipped - 7 lines]
 
L

lmcc via AccessMonster.com

Wow, that's exactly what I wanted. I had started researching doing a
FindFirst--dumb, dumb, dumb, anyway I knew it had to be something simple. I
was trying to find the answer myself before asking.

Thanks a lot! Yes, this is what I want--Group Header. Just tried it--
terrific!


John said:
Don't completely understand the question. You mention Header so I can guess
you are talking about a report (or a form).

Which header are you talking about? The Report Header, the page header, or a
group header?

Generally you can use a textbox with its control source set to
=Min([EventDate]) 'To get the earliest event date for the section of the report
=Max([EventDate]) 'To get the latest event date for the section of the report.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
I have a Date field for each event in my table. Each company will have a
range if they have more than one event--e.g., 7/7/90 - 1/5/94.
[quoted text clipped - 7 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top