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

Filter data based on an user selected date range 1

Status
Not open for further replies.

ramc2000

Technical User
Nov 8, 2002
60
GT
Does anyone know what I need to do in the select expert when I want my end users to be able to choose whether they want to see report data from the last week, last month or current year date ranges.

What I currently have in the select expert is a simple statement:

{DeliveryDate} in LastFullMonth

but I can't think of a way to give the end user the chance to select a different date range if they wanted to, I think I will need to create a parameter but don't really know how to make it work.
 
Create a parameter startdate and enddate and then in the record selection

{DeliveryDate} >= date(startdate) and
{DeliveryDate} <= date(enddate)

 
Or you can create a date parameter and choose allow range.

In your record selection,

{DeliveryDate} = ?daterange

-lw
 
You could create a string parameter {?dateperiod} with options: Last7Days, LastFullMonth, YearTtoDate.

Then go to report->selection formula->record and enter:

(
{?dateperiod} = "Last7Days" and
{table.date} in Last7Days
) or
(
{?dateperiod} = "LastFullMonth" and
{table.date} in LastFullMonth
) or
(
{?dateperiod} = "YearToDate" and
{table.date} in YeartoDate
)

This should pass to the SQL statement, too.

-LB
 
Thank you all, I finally went with lbass´s solution since it was the one more closely resembling what I wanted the end users to be able to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top