Forums

This topic is locked

DB question on dates...

Posted 05 Sep 2001 00:01:15
1
has voted
05 Sep 2001 00:01:15 Tim Generalao posted:
I have a question about searching for dates in an events calendar. Using Access,ASP and UD4. Each event inserted into DB on admin page has a start and end date field. Even if the event is one day, it must have a start and end date (i.e. 8/15/01).
My question is: How do I include every on going event in a search. For example, say there is an event that started in March and will end in November. When a user searches for events in the month of May, how do I make sure that the event will be included with the month of May results? Is it in Access that I will have to adjust something or is there some sort of mathematical SQL code that I need to write?
My DB table for events has the usual fields and a "start date" and "end date" field.
Any helpful ideas or tutorials would make my head stop hurting. I know there are great calendars written in UD for sale, but I want my own. Thank you so much in advance!

==>2<==

Replies

Replied 05 Sep 2001 01:20:24
05 Sep 2001 01:20:24 Owen Eastwick replied:
Try somehing like this:

1. Collect the search date from the Form.

varDate = Request("txtSearchDate"

2. Create the results recordset using a Query using the search date within the WHERE clause.

SELECT *
FROM YourTable
WHERE StartDate <= varDate AND EndDate >= varDate


Regards

Owen.



www.tdsf.co.uk/tdsfdemo

Reply to this topic