Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem with StartDate and StopDate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with StartDate and StopDate

 Post Reply Post Reply
Author
Student_MIS View Drop Down
Newbie
Newbie


Joined: 13 July 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Student_MIS Quote  Post ReplyReply Direct Link To This Post Topic: Problem with StartDate and StopDate
    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
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.