Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get my dbase to return only weekdays on calculation?

Status
Not open for further replies.

JohnGalt69

Technical User
Nov 15, 2002
1
US
I have built a small database with access which is linking tables from two other databases and extracting information from them. These copy over to a new table for referrencing a connecting table in the database. The information is then queried to a form for update and review of the non-linked data. That query has formulas in it to subtract days from a start date. Therein lies the problem...how do I get it to subtract the days but to ignore weekends? Also (please don't laugh) where do I put the criteria? Can I have the entire database ignore weekends or does it have to be query/form specific? I tried the following in a module under "general" with no success.

[Private Function IsWeekend(dtmTemp As Date) As Boolean
Select Case Weekday(dtmTemp)
Case vbSaturday, vbSunday
IsWeekend = True
Case Else
IsWeekend = False
End Select
End Function]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top