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

Date Field Parameter

Status
Not open for further replies.

samcneal

Technical User
Jan 11, 2005
20
US
I having problems passing datetime parameter from my main report through the subreports. The data is not congruent all the way through, indicating that the date is not being pass correctly. Can anyone help?
 
Try creating the same parameter in the subreport and using it in the subreport record selection formula. Then link the parameter of the main report {?datetime} to the parameter of the subreport {?datetime}, NOT to {?pm-?datetime}. In lower versions of CR, you would use the dropdown box in the lower left corner of the subreport linking screen to find the correct parameter.

-LB
 
Thanks but it doesn't allow me to choose a different parameter field when linking other than the ?pm-?begin date
 
You have to have created the parameter within the subreport and you have to have added it to the record selection criteria before it becomes available. Also note that it must be of the same datatype as the parameter in the main report.

-LB
 
Also when selecting a date from the drop down menu, it remains on the current date. For instance. I select May 1, 2005, when I run the report, it run against the current date not May 1, 2005.
 
Did you use the parameter in the record selection formula of the main report, as in:

{table.date} >= {?startdate}

-LB
 
Please provide your selection formula.

-LB
 
date({HQSoldLoansAnalysis;1.Sold Date}) >= ({?Begin Date})
and
date({HQSoldLoansAnalysis;1.Sold Date}) <= ({?End Date} )
and
(if {?AE}='ALL' then
{HQSoldLoansAnalysis;1.Account Executive}={HQSoldLoansAnalysis;1.Account Executive}
else {?AE}={HQSoldLoansAnalysis;1.Account Executive})

This is in the main report
 
I don't see anything obviously wrong here. If you drag your parameters into the report header, do they show the correct values?

-LB
 
Well, it only gives the current date, not the date that I submit to run the report against.
 
Did you by any chance check "range limited value" in the set default parameter screen without changing the date from the current date? Go to parameter->edit->set default->and check there for each parameter.

Also, what version of CR are you using?

-LB
 
I am running 8.5. I've changed the date parameter - range limited. I'm still having some problems. I'm testing it again and see if I missed something.
 
I'm confused, in selecting date when prompted by the user is what I need. Not sure why it forcing me to use the range date value.
 
I thought maybe the reason you were always getting the currentdate was because you might have checked "Range limited value" without changing the default dates (currentdate).

I was suggesting that you should either uncheck "Range limited value" for each of your parameters, OR select the range which you are willing to allow for each parameter. If you checked "range limited value" WITHOUT changing the dates shown in the range, your parameter would always use the currentdate.

-LB
 
I tried both ways and for some reason the current date comes in for both the begin and end date.

I tried without range and using discrete, that did not work. I've tried using range parameters and changing the date to not be the current date. I put in a big range, from the beginning of the year to the end. I can't seem to get past this date issue.
 
You should be using discrete date parameters for both parameters (do not allow multiple values and do not check range). Try unchecking "Range limited values". That should be all that is necessary to get this to work.

-LB
 
That is what I started with and I thought it should work as well; however, I'm not sure if it is data type that is causing the problem or what but it will not change from the current date even when selected. I'm going to check the data I am retrieving from the database because this is not right. Any ideas let me know.

The field is a datetime data type.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top