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

Date prompt use in Formula with DatePart? 2

Status
Not open for further replies.

supportsvc

Technical User
Jan 24, 2018
249
0
0
US
Hello,
Report is to show data for each week based on a date range prompt

I have this formula but it errors saying the {?DateRange} prompt I get an error

"A date is required here." with the {?DateRange} highlighted

Code:
 If DataPart("ww", ({TransactionDate}) = DatePart("ww",{?DateRange}) then Sum({TransactionQty}) else 0)
 
OK, so I have had another look at the file you uploaded most recently and apply the changes I suggested.

As explained in the post where I provided the formulas, for an End Date of 31 May the report will return the data for the 12 Full Weeks up to the Saturday prior to the End Date. This is so as to ensure all weeks reported are full weeks.

On this basis the report returns data for the period:

From: Week Ended Saturday 12 March,
To: Week Ended Saturday 28 May

To capture Data for the Week Ended 12 March, it needs to include transactions with a Transaction Date after 5 March (1 week earlier). {@StarDate} is therefore the day after 5 March, which is why the Record Selection Formula is for transactions > {@StarDate} and <= {@Week12}

Personally, I think the confusion is coming from the fact you have the Start and End Date parameters in the report heading, If you replace those with the appropriate formulas {@StarDate} and {@Week12} it might make more sense.

Hope this helps.
Pete.
 
Hello!
Thank you so very much!

That was it!

Now it shows the 3/5/2022 - 5/28/2022
And the Prompt is to enter the EndDate

I hope they are good with it too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top