Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    153

    Smile Unanswered: fetching week from thye month.

    Hi guys,
    i have a doubt. I want to know how to get the week number of the month. For example, if the date is 6th of any month then value for week should be 1, if the date is 19th then value should be 3.



    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Code:
    select ceiling(datepart(day, current_timestamp)/7.0)
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by sunny_007 View Post
    i have a doubt.
    you sure do

    you don't seem to know which database system you want to implement this on

    http://www.dbforums.com/mysql/166222...ied-month.html
    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
  •