Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Name of Day as Condition (97 SR2)

    Basically, i'm looking for a method of basing a statement on the name of today. So, If it's Friday, then execute code.

    If Date(Day) = "Friday" then
    run code
    end if

    I'm sure it's horrendously simple, I'm just not sure how I might do it. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Name of Day as Condition (97 SR2)

    How 'bout something from this:

    Sub day()
    ' all the bits and pieces are to identify what Now is
    MsgBox TypeName(Now) & vbLf & Now _
    & vbLf & Now Mod 7 & vbLf & IIf(Now Mod 7 = 0, "Friday", "Not Friday")
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Name of Day as Condition (97 SR2)

    If you have a date variable called dt then

    If Weekday(dt) = vbFriday Then
    Do this
    Else...

    or

    If Format(dt,"dddd"") = "Friday" then ....


    Andrew C

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Name of Day as Condition (97 SR2)

    Looks simple enough..

    Thanks Andrew!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

Posting Permissions

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