Results 1 to 2 of 2

Thread: VBSCRIPT - Between Time Spanning Over 2 Days

  1. #1

    Thread Starter
    Hyperactive Member johnweidauer's Avatar
    Join Date
    Sep 2002
    Location
    SLC, UT
    Posts
    314

    VBSCRIPT - Between Time Spanning Over 2 Days

    There may be an easier way to do this...

    I am trying to see if the user is logged in between 5:15 PM today and 1:55 AM tomorrow

    Code:
    If DATEDIFF("N",FormatDateTime(Date & " 5:15 PM", 0),FormatDateTime(Date & " " & Time, 0)) > 0 AND & _
    DATEDIFF("N",FormatDateTIme(DATEADD("D",1, Date) & " 1:55 AM", 0),FormatDateTime(Date & " " & Time, 0)) < 0 Then
    Returns 'True' if between the two times and dates specified

  2. #2

    Thread Starter
    Hyperactive Member johnweidauer's Avatar
    Join Date
    Sep 2002
    Location
    SLC, UT
    Posts
    314

    Flaw

    Yeah it works until the next day comes around, DANG!

    Let me know if you have a correction to this?

    May be just as easy to have a table record that is either on or off set by a DTS that runs every night and sets to off at 1:55 AM then turns on at 5:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width