Jump to content
Sign in to follow this  
likecoding

How to tell if next 45 days is the last 45 days of year

Recommended Posts

Hello,

How to return true if today plus 45 days is inside the  last 45 of the year? 

And return false if today plus 45 days is NOT  inside the last 45 day of the year?

 

todayDateIs = Date
todayPlus45Day =  DateAdd("d",45,todayDateIs) 

if todayPlus45Day inside the last 45 days of the year then 
return ture
elseif todayPlus45Day inside the last 45 days of the year then
return false
end if

I am not sure how to compare if todayPlus45Day is inside the last 45 days of the year? 

Thanks.

Share this post


Link to post
Share on other sites

Check the month and date.  If the month is 12 and the date is 31, then 45 days from now is the last day of the year.  Otherwise, check the year.  If the year isn't the current year then it's sometime within the last 45 days.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×