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

Inserting Data from Date Range AND only End Date of Date Range 1

Status
Not open for further replies.

spacemanspiffy04

Programmer
Feb 10, 2006
24
US
Hi,

I am creating a report where I need to insert data based on a user entered date range. This part is fine. However I also need to insert data associated with just the end date of this date range.

So, if the user enters 01/01/06 - 02/14/06, I need data from this range and also data from 02/14/06.

Thanks in advance for any help!
 
You need to explain this more thoroughly, since data would already be selected based on the end of the date range (unless you selected "do not include in range").

-LB
 
Hi,
The start and end of a range are included automatically.

Are you seeing some different behavior?

What is you record selection formula that uses the parameter?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi LB,

I need to report on which cases were created during a particular period. This period will be entered by the user in a date range. These cases identified by their id numbers will form one column on the report. I then need to create another column on the report that shows cases that were created on just the last date of this date range. So if the range was 01/01/06 - 02/14/06, this second column will include only those cases that were created on 02/14/06.

Column 2 in essense will be a subset of Column 1 and will be derived from the same databse field that Column 1 was derived. The tiles on the columns of my eventual report will look something like :

User ID || Cases from Date Range || User ID || Cases from End Date

Hope this explains it a little better? Thanks!
 
Hi Turkbear,

I get the data from the range entered without any problem. My problem arises when I try to create another column with just a subset of data from the date range data. I have included a better explanation above in response to LB's question.

Thanks!
 
If you use the date range in the record selection formula, as in:

{table.date} in {?daterange}

...then you can add the user ID and date to the detail field to get the first column. Then create two formulas for the second set of columns:

//{@UserID}:
if {table.date} = maximum({?daterange}) then {table.UserID}

//{@Date}:
if {table.date} = maximum({?daterange}) then {table.date}

Place these in the detail section also.

You could also just add the detail fields twice and then conditionally suppress the second set of fields, but it amounts to the same thing. I wonder whether this is really the display you will want though.

-LB
 
LB, Thanks once again for the help! It worked great. I am new to Crystal Reports, and am picking things up as I go along.

I had one more question; all the books I have say that when you select a date range, there is no way for the dates the user selects to be displayed on the report, and I was wondering if there is some way you can think of to make this happen?

Thanks!
 
Sure. Create a formula:

totext(minimum({?daterange}),"MM/dd/yyyy") + " to "+
totext(maximum({?daterange}),"MM/dd/yyyy")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top