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

Subtract Weeks from a date

Status
Not open for further replies.

wanzek1

Technical User
Jun 13, 2012
79
US
I want to be able to run a report without having to enter a beginning date. I would like to enter the ending date and create a formula for ending date minus 6 weeks.

Is this possible?
 
hi,

A week is 7 days and all date values are in days.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
How do you account for months with 30 days and months with 31 then?
 
A week is a week regardless of months with 28, 29, 30 or 31 days.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 

Could you post some examples and explanation of your concerns regarding month?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
The following formula would give you a date 6 weeks (42 days) prior to the end date parameter:

Code:
{?End_Date}-42

Is that what you are looking for?

Pete
 
I actually always need the Saturday of the week but I think I got it to work by just decreasing the # of days I am subtracting.

Thanks!
 
Your solution will only work if the report is only ever run on the same day each week. If the report can be run on any day of the week, the formula would need to be dynamic.

This also demonstrates the problem with not fully describing the issue you are trying to resolve.

Pete

 

INT(({somedate})/7)*7

This will return the Sat for and date in the week

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top