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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate only bussiness days

Status
Not open for further replies.

timppap

Technical User
Feb 10, 2006
7
SE
Hi !
I have following code

new_sasdate = input(osjomtpv,yymmdd8.);
-----------------

if new_sasdate - today() <= 5 then osinko ="DIVIDEND" ;
TEST=new_sasdate - today();
if TEST < 0 then osinko ="" ;

This calculate also Saturday and Sunday but I don't want that ?

Thanks for any help !
 
What about an IF/ELSE?

Maybe something like...

new_sasdate = input(osjomtpv,yymmdd8.);


if new_sasdate - today() <= 5 then osinko ="DIVIDEND";
else
if weekday(new_sasdate) = 1 then osinko ="";
else
if weekday(new_sasdate) = 7 then osinko ="";

TEST=new_sasdate - today();
if TEST < 0 then osinko ="" ;
 
Ok I have to try !

It must work like this !

Today is example Wednesday 6.4 and the new_sasdate = 12.4 so the test day (new_sasdate - today())should be 3 !?

Br
Timo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top