Stupid little VB question

Discussion in 'OT Technology' started by 5Gen_Prelude, Nov 3, 2003.

  1. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    I seem to always have to figure out the last day in the current month. Is there a better way than this?:

    day(dateadd("d",-1,month(dateadd("m",1,now())) & "/01/" & year(dateadd("m",1,now()))))

    :dunno:
     
  2. panzerfaust

    panzerfaust New Member

    Joined:
    Oct 13, 2003
    Messages:
    1,604
    Likes Received:
    0
    Location:
    Far far away
    How about
    Day(DateSerial(Year(pDate), Month(pDate) + 1, 0)
    where pDate is some date
     
  3. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    I don't think that would take into consideration December.
     
  4. panzerfaust

    panzerfaust New Member

    Joined:
    Oct 13, 2003
    Messages:
    1,604
    Likes Received:
    0
    Location:
    Far far away
    try it before you knock it
     
  5. panzerfaust

    panzerfaust New Member

    Joined:
    Oct 13, 2003
    Messages:
    1,604
    Likes Received:
    0
    Location:
    Far far away
    you're using vb6 i'm assuming

    if it's vb7 then try
    System.DateTime.DaysInMonth(...)

     
  6. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    I stand corrected - :bigthumb:
     
  7. panzerfaust

    panzerfaust New Member

    Joined:
    Oct 13, 2003
    Messages:
    1,604
    Likes Received:
    0
    Location:
    Far far away

Share This Page