Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: Next Month Calculation

    Hi: Can any one please tell me how to i calculate the next month starting day and next month ending date. For example if this is january then i need the next month that is february starting day and february ending day. I need to calculate the date in that way given below, I mean without query. Below method is i use it to calculate the todays date and the end of the day.

    MonthLastDay = Empty
    dFirstDayNextMonth = DateSerial(CInt(Format(dCurrDate, "yyyy")), CInt(Format(dCurrDate, "mm")) + 1, 1)
    MonthLastDay = DateAdd("d", -1, dFirstDayNextMonth)

    Thanks,

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    that's gonna fail in december
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Paul

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    my bad :blush:

    i underestimated microsoft access again!

    DateSerial(2006,13,1) does indeed generate 2007-01-01

    sorry
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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