Displaying date

  • Thread starter Thread starter Alex H
  • Start date Start date
A

Alex H

Hi - hope someone can help me.

I have a table which contains two date fields - Start Date and End Date and
an event field
What I am trying to do and getting hopelessly lost is to select all the
events for the next seven days and within the two date fields.

Ialso need to display the date with the day name

Is this possible please

thanks

Alex
 
Alex,

Do you mean the Events where *any part of the event* is within the next
seven days? If so, I guess you need to cover off these possibilities:
Start before today and End after today
Start within the next 7 days
If you are using the query design view, in the Criteria of the Start
Date field, put like this...
<Date()
.... and on the same row of the Criteria, in the End Date field, put like
this...
Then in the next row of the query design grid, in the Start Date field,
put like this...
Between Date() and Date()+7

As for the display of the dates, I assume this applies to a form or
report. Use the Format property of the control (textbox) on the form or
report itself to control this. Mayne it will be something like this...
"dddd mmm d yyyy"
 
Thanks Steve, so far so go
However I am sorry but I didn't explain very well

We might have an event start date of say 28/10/05 with an end date of the
same day - this would be a one off event. However we might also have a
start date of 01/10/05 and an end date of 29/10/05 . This event would take
place on 1st,8th,15th, 22nd and 29th .

What I am trying to do is display all the events that will be happening in
the next seven days and the date on which they will occur.

I suspect I might need some additional fields?

Thanks for your help

Alex
 
Alex,

Yes. It seems to me that the event that takes place on 1st, 8th, 15th,
22nd and 29th, you have no way of knowing that these are the dates for
this event, simply based on a Start Date and End Date. I think you
should scrap the Start Date and End Date fields from the Events table.
I think you will need an additional table in your database, for
EventDates, with fields like this...
EventDateID
EvenID (links to Primary Key of Events table)
EventDate

That means for the event in your example, there will be 5 records, each
with the EventID of the actual event, and listing each of the 5 dates
that the event runs.

Then it will be very easy to find events where one or more days of
running is within the next 7 days. This will be based on a criteria on
the EventDate field in your query.
 
Alex H said:
Thanks Steve, so far so go
However I am sorry but I didn't explain very well

We might have an event start date of say 28/10/05 with an end date of the
same day - this would be a one off event. However we might also have a
start date of 01/10/05 and an end date of 29/10/05 . This event would take
place on 1st,8th,15th, 22nd and 29th .

What I am trying to do is display all the events that will be happening in
the next seven days and the date on which they will occur.

I suspect I might need some additional fields?

Thanks for your help

Alex

Alex,

With a start date of 01/10/05 and an end date of 29/10/05 for the
series of events, how does the database show that the individual
events in the overall series will take place on the 1st, 8th, 15th,
22nd, and 29th?


Sincerely,

Chris O.
 
Steve said:
Alex,

Yes. It seems to me that the event that takes place on 1st, 8th, 15th,
22nd and 29th, you have no way of knowing that these are the dates for
this event, simply based on a Start Date and End Date.
[...]

Not necessarily. It may be that all possible event dates are a multiple
of 7 days from the first; if so, [Start Date] and [End Date] would suffice.

Even if there are some rare exceptions, those might be taken into
account via multiple records for the same event series, rather than by
adding a new Table.

-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 
Back
Top