Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    4

    Unanswered: Find second saturday

    Please let me know how can I find second saturday for current month?

    Thanks.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    go here: http://oreilly.com/catalog/sqlhks/chapter/ch04.pdf

    scroll down to Hack #23 Second Tuesday of the Month

    if you understand how that's done, you can easily adapt it to produce the 2nd saturday instead

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

  3. #3
    Join Date
    Feb 2009
    Posts
    4
    Thank you very much for the reply. If you have any handy sybase query that will be helpful.

    Aprpeciate your help.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    nope, you'll have to figure out the sybase syntax yourself

    but you're lucky, the formula for 2nd saturday is a lot simpler, it's just 14-B
    Code:
     A     B      C    
    1st  wkday  14-B   
    sun    1     13    
    mon    2     12    
    tue    3     11    
    wed    4     10    
    thu    5      9    
    fri    6      8    
    sat    7      7
    C is the number of days to add the the date of the first day of the month, to give you the date of the second saturday
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2009
    Posts
    4
    Thank you very much for quick resposen & help. Thank you.

Posting Permissions

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