If condition

Discussion in 'ASP General' started by dave, Apr 4, 2005.

  1. dave

    dave Guest

    Hi
    I need bit code to execute some part of code...
    Something like

    If ( its between friday 7.30 PM and monday 11 AM) Then

    'execute this part of code

    End if

    Basically I want to check current system date and time and need if condition if its falls between friday 7:30 pm and monday 11 am)...
    Can anyone help me to write If condition to fullfil my requirements...
    Thanx in advance
    dave
     
    dave, Apr 4, 2005
    #1
    1. Advertising

  2. Some random articles that might help you though they do not address the
    issue specifically

    http://www.codeave.com/asp/code.asp?u_log=61

    http://www.grape-info.com/doc/web/asp/contents2.html

    http://www.psacake.com/web/gt.asp


    "dave" <> wrote in message
    news:...
    Hi
    I need bit code to execute some part of code...
    Something like

    If ( its between friday 7.30 PM and monday 11 AM) Then

    'execute this part of code

    End if

    Basically I want to check current system date and time and need if condition
    if its falls between friday 7:30 pm and monday 11 am)...
    Can anyone help me to write If condition to fullfil my requirements...
    Thanx in advance
    dave
     
    Christopher Williams, Apr 4, 2005
    #2
    1. Advertising

  3. Some random articles that might help you though they do not address the
    issue specifically

    http://www.codeave.com/asp/code.asp?u_log=61

    http://www.grape-info.com/doc/web/asp/contents2.html

    http://www.psacake.com/web/gt.asp

    --
    Christopher Williams

    www.PowerASP.com
    www.CJWSoft.com


    "Christopher Williams" <> wrote in message
    news:%...
    > Some random articles that might help you though they do not address the
    > issue specifically
    >
    > http://www.codeave.com/asp/code.asp?u_log=61
    >
    > http://www.grape-info.com/doc/web/asp/contents2.html
    >
    > http://www.psacake.com/web/gt.asp
    >
    >
    > "dave" <> wrote in message
    > news:...
    > Hi
    > I need bit code to execute some part of code...
    > Something like
    >
    > If ( its between friday 7.30 PM and monday 11 AM) Then
    >
    > 'execute this part of code
    >
    > End if
    >
    > Basically I want to check current system date and time and need if
    > condition if its falls between friday 7:30 pm and monday 11 am)...
    > Can anyone help me to write If condition to fullfil my requirements...
    > Thanx in advance
    > dave
    >
     
    Christopher Williams, Apr 4, 2005
    #3
  4. dave wrote:
    > Hi
    > I need bit code to execute some part of code...
    > Something like
    >
    > If ( its between friday 7.30 PM and monday 11 AM) Then
    >
    > 'execute this part of code
    >
    > End if
    >
    > Basically I want to check current system date and time and need if
    > condition if its falls between friday 7:30 pm and monday 11 am)...
    > Can anyone help me to write If condition to fullfil my requirements...
    > Thanx in advance
    > dave


    function IsWeekend(dNow)
    dim dTmp, dFri, dMon
    dTmp= DateSerial(Year(dNow),Month(dNow),Day(dNow)) 'Date()
    Do Until WeekDay(dTmp, vbSunday)= vbFriday
    dTmp=DateAdd("d",-1,dTmp)
    Loop
    dFri=CDate(dTmp & " 19:30")
    dMon=CDate(DateAdd("d",3,dTmp) & " 11:00")
    If dNow >= dFri AND dNow <= dMon Then
    IsWeekend = true
    else
    IsWeekend = false
    end if
    end function
    msgbox isweekend(Now),,Now
    msgbox isweekend(dateadd("d",1,Now)),,dateadd("d",1,Now)


    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Apr 4, 2005
    #4
  5. dave

    dave Guest

    Thanx Bob
    Really appreciated...
    dave

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > dave wrote:
    > > Hi
    > > I need bit code to execute some part of code...
    > > Something like
    > >
    > > If ( its between friday 7.30 PM and monday 11 AM) Then
    > >
    > > 'execute this part of code
    > >
    > > End if
    > >
    > > Basically I want to check current system date and time and need if
    > > condition if its falls between friday 7:30 pm and monday 11 am)...
    > > Can anyone help me to write If condition to fullfil my requirements...
    > > Thanx in advance
    > > dave

    >
    > function IsWeekend(dNow)
    > dim dTmp, dFri, dMon
    > dTmp= DateSerial(Year(dNow),Month(dNow),Day(dNow)) 'Date()
    > Do Until WeekDay(dTmp, vbSunday)= vbFriday
    > dTmp=DateAdd("d",-1,dTmp)
    > Loop
    > dFri=CDate(dTmp & " 19:30")
    > dMon=CDate(DateAdd("d",3,dTmp) & " 11:00")
    > If dNow >= dFri AND dNow <= dMon Then
    > IsWeekend = true
    > else
    > IsWeekend = false
    > end if
    > end function
    > msgbox isweekend(Now),,Now
    > msgbox isweekend(dateadd("d",1,Now)),,dateadd("d",1,Now)
    >
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
     
    dave, Apr 5, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohammed  A khader

    one-hot encoding and fale-safe condition.

    Mohammed A khader, Jan 24, 2005, in forum: VHDL
    Replies:
    12
    Views:
    3,306
    Mike Treseler
    Feb 1, 2005
  2. Daniel

    while condition

    Daniel, May 20, 2005, in forum: VHDL
    Replies:
    7
    Views:
    3,533
    Ralf Hildebrandt
    May 23, 2005
  3. Replies:
    0
    Views:
    432
  4. -
    Replies:
    12
    Views:
    698
    Remon van Vliet
    Jun 15, 2005
  5. Bill W.
    Replies:
    13
    Views:
    299
    Phillip Gawlowski
    May 9, 2011
Loading...

Share This Page