#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    7
    Rep Power
    0

    Returning alternate rows from a query


    Hello all-
    Any thoughts about how one could return alternate records in an MS SQL
    query hitlist? The specific application is that I'm performing a query that
    returns a group of records in a date range -- say, every "Monday" record. I'd like
    to have the query be able to select every other Monday instead, if the
    user so desires.

    Thanks in advance!

    - Tom Tedeschi
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    use DATEPART(ww...) to get odd/even week numbers


    rudy
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    7
    Rep Power
    0
    Great, thanks!
    -TRT

IMN logo majestic logo threadwatch logo seochat tools logo