Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006

    Unanswered: Date function dilemma

    Can anyone tell me how to caluculate the last day of the prior month using getdate() ?

    The function will be hardcoded in a query that will run on either of the 1st 7 days of the month - Specifically the the 1st through the 7th day of the following month, for every month of the year.

    Thanks in advance for any help.

  2. #2
    Join Date
    May 2005
    South Africa
    Provided Answers: 1
    select dateadd(dd,-1,dateadd(mm, datediff(mm,'20000101',getdate()),'20000101'))

Posting Permissions

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