SOLVED

Period of Time on a Report

%3CLINGO-SUB%20id%3D%22lingo-sub-2174895%22%20slang%3D%22en-US%22%3EPeriod%20of%20Time%20on%20a%20Report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2174895%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20have%20a%20query%20that%20gives%20me%20totals%20based%20on%20Start%20and%20End%20date.%20Basically%20when%20I%20open%20the%20query%20a%20dialog%20box%20will%20open%20asking%20for%20Start%20and%20End%20date%2C%20then%20it%20gives%20me%20the%20results%20I%20need.%3C%2FP%3E%3CP%3EMy%20question%20is%3A%20can%20I%20get%20the%20input%20(start%2C%20end%20date)%20visualized%20like%20a%20period%20in%20a%20report%3A%20for%20example%20%5BStart%20Date%5D%3D02%2F01%2F2021%2C%20%5BEnd%20Date%5D%3D02%2F20%2F2021%2C%20then%20there%20will%20be%20a%20Time%20Period%20on%20a%20report%20that%20will%20show%20%5BPeriod%5D%3D02%2F01%2F2021%20-%2002%2F20%2F2021%3C%2FP%3E%3CP%3EAny%20ideas%20will%20be%20appreciated%3C%2FP%3E%3CP%3EThanks%20in%20advance%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2174895%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2178290%22%20slang%3D%22en-US%22%3ERe%3A%20Period%20of%20Time%20on%20a%20Report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2178290%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F965736%22%20target%3D%22_blank%22%3E%40PetarV%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20standard%20way%20most%20experienced%20Access%20developers%20use%20is%20to%20launch%20the%20query%20from%20a%20form.%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20that%20form%20you%20place%20two%20text%20box%20controls%3A%20StartDate%20and%20EndDate.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20query%2C%20change%20that%20criteria%20reference%20from%20the%20input%20boxes%20to%20the%20controls%20on%20the%20form%3A%3CBR%20%2F%3EBetween%20Forms!YourFormNameGoesHere.txtStartDate%20and%20Forms!YourFormNameGoesHere.TxtEndDate%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20the%20query%20is%20filtered%20on%20open%20by%20the%20values%20in%20those%20controls.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%2C%20your%20report%20can%20ALSO%20have%20two%20controls%20that%20reference%20those%20same%20form%20controls%3C%2FP%3E%3CP%3E%3DForms!YourFormNameGoesHere.txtStartDate%3C%2FP%3E%3CP%3Eand%3C%2FP%3E%3CP%3E%3DForms!YourFormNameGoesHere.TxtEndDate%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

I have a query that gives me totals based on Start and End date. Basically when I open the query a dialog box will open asking for Start and End date, then it gives me the results I need.

My question is: can I get the input (start, end date) visualized like a period in a report: for example [Start Date]=02/01/2021, [End Date]=02/20/2021, then there will be a Time Period on a report that will show [Period]=02/01/2021 - 02/20/2021

Any ideas will be appreciated

Thanks in advance 

2 Replies
best response confirmed by PetarV (New Contributor)
Solution

@PetarV 

The standard method most experienced Access developers use is to launch the query from a form. 

On that form you place two text box controls: StartDate and EndDate. 

 

In the query, change that criteria reference from the input boxes to the controls on the form:
Between Forms!YourFormNameGoesHere.txtStartDate and Forms!YourFormNameGoesHere.TxtEndDate

 

Now, the query is filtered on open by the values in those controls.

 

And, your report can ALSO have two controls that reference those same form controls

=Forms!YourFormNameGoesHere.txtStartDate

and

=Forms!YourFormNameGoesHere.TxtEndDate

 

 

Thank you so much