Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net SQL Count working days between two days

Hi

I am using the following SQL query to pull data from a table called performance. I also want to include a column that
calculates the difference between the [From Date] and [To Date] excluding weekends. How I do this without having to add a SQL function as I am using the SQL statement in VB.net code? Thanks

Select Distinct [Hole Number], Min([Date])As [From Date], Max([Date]) As [To Date], Max([Drilled To]) As [Depth Drilled]
From Performance Group By [Hole Number]

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can try adding a column with the DateDiff(day,max(date),min(date)) as [date diff]
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much