Determine If a Date Falls on a Weekend or on a Holiday in Access 2003

  • Thread starter Charles Phillips
  • Start date
C

Charles Phillips

Hello,
I have an MS-Access 2003 database.
I have a field name "Follow-up Date", that's automatically populated.
I want the Follow-up Date to be a day/date that does not fall on the
weekend.
I have read "Determine If a Date Falls on a Weekend or on a Holiday in
Access", but do not understand "how-to" to put this code in the Follow-up
Date field.

Here is the code for the "Follow-up Date" field:

=DateAdd("d",3,[DateLaptopReturned])

How and were do I put the code, that allows the system to skip ANY weekend
days/dates, and still publish the next Monday or Tuesday???

Can someone point me to some examples/samples???


Thank you,


Charles L. Phillips
 
G

Guest

using the DatePart function you can determine the day of the week.

Followupdt=DateAdd("d",3,[DateLaptopReturned])
Mydate=DatePart("w",Followupdt)

If MyDate = 1 then 'Sunday therefore add 1 more day
Followupdt=DateAdd("d",4,[DateLaptopReturned])
ElseIf Mydate= 7 Then 'Saturday therefore add 2 more days
Followupdt=DateAdd("d",5,[DateLaptopReturned])
End If

Hope this helps,

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top