Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > If condition

Reply
Thread Tools

If condition

 
 
dave
Guest
Posts: n/a
 
      04-04-2005
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
 
Reply With Quote
 
 
 
 
Christopher Williams
Guest
Posts: n/a
 
      04-04-2005
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


 
Reply With Quote
 
 
 
 
Christopher Williams
Guest
Posts: n/a
 
      04-04-2005
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
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      04-04-2005
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"


 
Reply With Quote
 
dave
Guest
Posts: n/a
 
      04-05-2005
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"
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with while condition OR condition Bill W. Ruby 13 05-09-2011 09:42 PM
Condition outside loop or separate loop for different condition? - Java 12 06-15-2005 08:50 AM
while condition Daniel VHDL 7 05-23-2005 02:29 PM
one-hot encoding and fale-safe condition. Mohammed A khader VHDL 12 02-01-2005 04:24 PM
string condition file - lookup logic jason@cyberpine.com Perl 0 08-10-2004 07:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57