weekday simple code

alwazeer

Registered User.
Local time
Yesterday, 19:02
Joined
Nov 9, 2011
Messages
36
Hi
i have a code that shows the days of the week, i want to except Friday and Saturday and not to show them in the report.

Code:
Function GetNthDay(d As Date, n As Integer) As Date
''   Returns a date that is the Nth day of the given month and year
    GetNthDay = DateSerial(Year(d), Month(d), n)
End Function


Function GetNextWeekday(d1 As Date) As Date
'   Returns the first weekday that occurs on or after the given date
  '            'in most cases this is correct
  GetNextWeekday = d1
  
End Function
 
filter your report's Record Source:

Select * From yourTable Name where Format([yourDateField],"dddd") <> "Friday" And Format([yourDateField],"dddd") <> "Saturday"
 
Thanks for Ur Reply
but there is no source just a report
if u please look at the attachment and u will understand what i mean
thanks
 

Attachments

good work arnelgp
but i want to make the month changeable how can i do that??
i want to change it from a form.

thanks
 
do you need to report all the days in a month or just the 7 days?
 
run the sample form (frmSample). examine the code behind the command button (view report).
 

Attachments

This is a wonderful work
Thank you so much
This is exactly what I needed
thanks arnelgp
 

Users who are viewing this thread

Back
Top Bottom