Duedate

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2000
Two text boxes: DD and Duedate
When someone dies and a federal estate tax return is required, it is due 9
months following the date of death, unless the due date falls on a weekend or
holiday. How can I get the due date to move to the first business day
following a weekend or holiday?
Thanks,
 
Well the weekend is the easy part. Something like below is close. It gets you
9 months after the DD. If the DD is on a weekend it will move the Saturday
dates to Monday and Sunday dates to Tuesday. Needs a little work.

Expr1: IIf(DatePart("w",DateAdd("m",9,[DD])) In
(1,7),DateAdd("m",9,[DD])+2,DateAdd("m",9,[DD]))

Holidays are the problem. You are going to need a table of holidays and
populate it out into the needed future. Then you are going to have to check
the date against these. If it's Thanksgiving you'll have to move it to
Friday. Christmas and New Years can also be a problem as they move around
some. Monday holidays should be simpler.
 
Hi Howard

The Weekday function returns a number representing the day of the week for
the given date (1=Sunday, 2=Monday, etc). So, you could write a small
function to add 9 months to the death date and then add another one or two
days if the resulting weekday is 1 or 7, respectively:

Public Function CalcDueDate(dtDeath as Date) as Date
Dim dtDue as Date
dtDue = DateAdd( "m", 9, dtDeath)
Select Case Weekday(dtDue)
Case 1
dtDue = dtDue + 1
Case 7
dtDue = dtDue + 2
End Select
CalcDueDate = dtDue
End Function
 
Thanks to both of you! I can live without the holiday part.
--
Howard


Graham Mandeno said:
Hi Howard

The Weekday function returns a number representing the day of the week for
the given date (1=Sunday, 2=Monday, etc). So, you could write a small
function to add 9 months to the death date and then add another one or two
days if the resulting weekday is 1 or 7, respectively:

Public Function CalcDueDate(dtDeath as Date) as Date
Dim dtDue as Date
dtDue = DateAdd( "m", 9, dtDeath)
Select Case Weekday(dtDue)
Case 1
dtDue = dtDue + 1
Case 7
dtDue = dtDue + 2
End Select
CalcDueDate = dtDue
End Function

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Howard said:
Access 2000
Two text boxes: DD and Duedate
When someone dies and a federal estate tax return is required, it is due 9
months following the date of death, unless the due date falls on a weekend
or
holiday. How can I get the due date to move to the first business day
following a weekend or holiday?
Thanks,
 
Back
Top