|
-
Dec 7th, 2000, 10:51 AM
#1
Thread Starter
Hyperactive Member
I am building a calendar and have ideas that I don't know how to build. I have the basic functionality pulling from a database and so on to make the calendar work. What I want to do is make the home page automatically pull up the next 4 hours of schedules and display them on the page. I'm sure there is something that compares Now to the database, but I don't know how to do it. Please assist with that if you can. Thanks.
If you think education is expensive, try ignorance.
-
Dec 7th, 2000, 10:59 AM
#2
You could do something like this:
Dim dteStart
Dim dteEnd
dteStart = Now()
dteEnd = DateAdd("h", 4, dteStart)
To get your starting and ending dates/times and then use some SQL on your database that looked like this:
' SQL Server:
Set rstSchedule = conYourConnection.Execute("SELECT * FROM YourScheduleTable WHERE YourScheduleTablesDateField BETWEEN '" & dteStart & "' AND '" & dteEnd & "'")
' Access (97):
Set rstSchedule = conYourConnection.Execute("SELECT * FROM YourScheduleTable WHERE YourScheduleTablesDateField BETWEEN #" & dteStart & "# AND #" & dteEnd & "#")
Good luck,
Paul
-
Dec 7th, 2000, 11:28 AM
#3
Thread Starter
Hyperactive Member
That's exactly what I was looking for. Thanks
If you think education is expensive, try ignorance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|