Print Page | Close Window

Problem with StartDate and StopDate

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=15830
Printed Date: 30 March 2026 at 5:05am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem with StartDate and StopDate
Posted By: Student_MIS
Subject: Problem with StartDate and StopDate
Date Posted: 13 July 2005 at 2:05pm
Hello,
I have a very simple MS access database to store vacation information with few data like first name, last name, startdate, stopdate, and location. I am trying to creat an ASP report to list: 1) day (e.g. Mon, Tue, Wed...) and 2) the persons on leave for that day.
This sounds simple enough, but I am having problem with the report as far as the startdate and stopdate. In this case, I can't just select a startdate or stopdate to list the persons, but I need to list the individual day(or date) for the week/month that shows the persons on vacation.
 
The report would look something like this:
Tues,  July 13, 2005
  Brad Pitt
  Jennifer Aniston
  Tom Cruise
Wed, July 14, 2005
  Jennifer Aniston
  Steve Martins
Thur, July 15, 2005
  Jennifer Aniston
  Steve Martins 
and so forth... (In this case, Jennifer is on leave from 13 July (Startdate) to 15 July (StopDate) and Steve Martins is on leave from July 14 - July 15).
I wish to generate a list of dates to show all the persons on leave on a particular date.
Could someone show me the simple code(method) on how to do this. Does this involve a For...Next loop to get the date in between the startdate and stopdate? I am not exactly sure where to begin...

Your help is greatly appreciated!

Thanks,

Sara



Replies:
Posted By: ub3rl337ch3ch
Date Posted: 17 July 2005 at 9:40pm
thedate = <whatever date you want to start on>
enddate = <whatever date you want it to end on>
 
do until thedate = enddate
sql = "SELECT firstname, lastname, location FROM tbl WHERE startdate <= #" & thedate & "# <= enddate"
vrec.open
'use response.write to display
 
thedate = dateadd("d",1,thedate)
loop
 
 
something along those lines anyway...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net