Using GetBusinessDay with DateAdd

P

PeteyP

How/where would I kick off the GetBusinessDay function in the following query
expression. I want to calculate 120 days ahead and, if that date falls on a
weekend or holiday, get the next business day.:

Express1: IIf([Ident]=4 And
[Formal]=0,DateAdd("d",+120,[CCRScopeInitSigDate]),"0")

I have successfully used GetBusinessDay in the following:

PlanD1: IIf([Deadline]>#1/1/2001#,GetBusinessDay([Deadline],-20))

Tried searching for an answer and hope I didn't miss it. Thanks in advance
for the help.
 
K

KARL DEWEY

UNTESTED --
Express1: IIf([Ident]=4 And
[Formal]=0,GetBusinessDay(DateAdd("d",+120,[CCRScopeInitSigDate])),"0")
 
P

PeteyP

Thanks for the suggestion. Unfortunately the combination of function and
expression is returning weekend and holiday dates. Is there such a thing as
Next Business Day that I could apply to the results for Express1 ?

Thanks again!

KARL DEWEY said:
UNTESTED --
Express1: IIf([Ident]=4 And
[Formal]=0,GetBusinessDay(DateAdd("d",+120,[CCRScopeInitSigDate])),"0")

--
KARL DEWEY
Build a little - Test a little


PeteyP said:
How/where would I kick off the GetBusinessDay function in the following query
expression. I want to calculate 120 days ahead and, if that date falls on a
weekend or holiday, get the next business day.:

Express1: IIf([Ident]=4 And
[Formal]=0,DateAdd("d",+120,[CCRScopeInitSigDate]),"0")

I have successfully used GetBusinessDay in the following:

PlanD1: IIf([Deadline]>#1/1/2001#,GetBusinessDay([Deadline],-20))

Tried searching for an answer and hope I didn't miss it. Thanks in advance
for the help.
 
K

KARL DEWEY

There are probably beter ways to do this but try this using a table named
CountNumber with field CountNUM containing 0 (zero) through 200 and your
table name instead of PeteyP --
PeteyP_1 ---
SELECT PeteyP.CCRScopeInitSigDate,
DateAdd("d",[CountNUM],[CCRScopeInitSigDate]) AS End_Date
FROM PeteyP, CountNumber
WHERE (((Format(DateAdd("d",[CountNUM],[CCRScopeInitSigDate]),"w"))<>1 And
(Format(DateAdd("d",[CountNUM],[CCRScopeInitSigDate]),"w"))<>7))
ORDER BY PeteyP.CCRScopeInitSigDate,
DateAdd("d",[CountNUM],[CCRScopeInitSigDate]) DESC;

SELECT Q.CCRScopeInitSigDate, Q.End_Date
FROM PeteyP_1 AS Q
WHERE ((((SELECT COUNT(*) FROM PeteyP_1 Q1
WHERE Q1.[CCRScopeInitSigDate] = Q.[CCRScopeInitSigDate]
AND Q1.End_Date < Q.End_Date)+1)=120));

--
KARL DEWEY
Build a little - Test a little


PeteyP said:
Thanks for the suggestion. Unfortunately the combination of function and
expression is returning weekend and holiday dates. Is there such a thing as
Next Business Day that I could apply to the results for Express1 ?

Thanks again!

KARL DEWEY said:
UNTESTED --
Express1: IIf([Ident]=4 And
[Formal]=0,GetBusinessDay(DateAdd("d",+120,[CCRScopeInitSigDate])),"0")

--
KARL DEWEY
Build a little - Test a little


PeteyP said:
How/where would I kick off the GetBusinessDay function in the following query
expression. I want to calculate 120 days ahead and, if that date falls on a
weekend or holiday, get the next business day.:

Express1: IIf([Ident]=4 And
[Formal]=0,DateAdd("d",+120,[CCRScopeInitSigDate]),"0")

I have successfully used GetBusinessDay in the following:

PlanD1: IIf([Deadline]>#1/1/2001#,GetBusinessDay([Deadline],-20))

Tried searching for an answer and hope I didn't miss it. Thanks in advance
for the help.
 

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