Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Date Difference
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Date Difference

 Post Reply Post Reply
Author
janice View Drop Down
Newbie
Newbie


Joined: 07 August 2003
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote janice Quote  Post ReplyReply Direct Link To This Post Topic: Date Difference
    Posted: 07 August 2003 at 8:28pm

Please help to get this to work.

My display screen is set up like this:

        Play Date               endDate     Diff
A       07/20/2003              
B       07/21/2003
C       07/22/2003

A       07/26/2003              
B       07/27/2003
C       07/28/2003




When I run this code snipp below,
I expect to see the difference between Play Date and End Date and  then that difference appears in Diff Column

The date is not getting calculated properly.

First, in each row, I get same date difference.
For instance, row one, if the endDate is 08/05/2003,
 I expect to see 18 in the first A-row, 17 in first B-row, and 16 in
first C-row.

I am getting 18 in all 3 rows.

Same with second row of data.
In second row, for instance starting with 07/26/2003: if the end date is 08/05/2003, all values for diff are the same.
They are all number 11

The 3 difference PlayDates are the dates each row is expected to

play their games.

The endDate is the actual date each row plays their games.

What we are trying to determine is how many days it took each row to play their games.

For instance, if playDate1 is 08/03/2003 and endDate is 08/08/2003, we would like to print a message that says " 5 days past playdate.

So far, none of them is working.


Below is my code snippet.


Dim days
Dim PlayDate1, PlayDate2, PlayDate3
Dim enddate

Do While Not rst.EOF
PlayDate1= dateAdd("d", 1,rst("endDate"))
PlayDate2= dateAdd("d", 2,rst("endDate"))
PlayDate3= dateAdd("d", 3,rst("endDate"))
enddate = rst("actual")

If playDate1 > endDate  Then
    days = DateDiff("d", PlayDate1, enddate)
ElseIf playDate2   > endDate   Then
    days = DateDiff("d", PlayDate2, enddate)
ElseIf playDate3   > endDate   
  days = DateDiff("d", PlayDate3, enddate)

End If

Response.Write "<font color=""#000000"">" & days & " days past play date</font>"  

  rst.MoveNext
Loop

 

Thanks for your help!

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.