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

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Date Diff Exclude Weekends as Select Only, No Function


    Is there a way to do a date diff to exclude weekends without a function? I've searched the web but everything seems to require a function. Trying to do the date diff in a select statement.


    Thanks for the help!
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,261
    Rep Power
    4279
    Originally Posted by kaneda0149
    Is there a way to do a date diff to exclude weekends without a function?
    yes, by joining to a calendar table (where calendar date between start date and end date), counting the non-weekend days
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0
    I see... let me try that out. Thank you for the quick response!

IMN logo majestic logo threadwatch logo seochat tools logo