Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006

    Unanswered: SQl date question.

    Hi there,

    I want to select the first day of the actual month. i tryed this:

    select dateadd(mm,-1,getdate()) but it shows me the actual date, less one month not the first day of the amonth.

    Thanks everyone

  2. #2
    Join Date
    Dec 2005
    you might need to do this -

    select dateadd(day, -(datepart(dd, getdate())) + 1, getdate())

    to get first day of the month given current date. the behavior shown by your select is correct, it'll give take you back one month from current date.

  3. #3
    Join Date
    Mar 2006


    Hi there thankssssssssssssssssssssssssssssssssss a lot
    it works
    you saved me.

Posting Permissions

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