Skip to main content

I’m working on a report based entirely off of PMTRAN (with PMCOSTCODE linked in to give me access to CostCodeCD).  I’m starting with parameters for project, startperiod & endperiod.  I’m then trying to filter so that I only select records from PMTRANS where PMTRAN.ProjectID = @project and where PMTRAN.FINPERIODID is between @startperiod and @endperiod.

I can’t seem to get my date parameters into a format that is consistent with PMTRAN.FINERIODID.  I’ve tried

  1. creating the parameters as ‘string’, ‘date’, and ‘integers’.
  2. creating a variable based on the parameters to put them in yyyymm format.
  3. creating variables to put all of the dates into yyyymm format.

nothing seems to work.

This is how I’m defining the parameters

view name
=Report.GetFieldSchema('OrganizationBranchReportParameters.FinPeriodID')

default value
=Report.GetDefExt('OrganizationBranchReportParameters.FinPeriodID')

But I’ve also tried

view name
=Report.GetFieldSchema('PMTran.FinPeriodID')

default value
=Report.GetDefExt('OrganizationBranchReportParameters.FinPeriodID')

 

I’ve looked at a bunch of other reports where period ranges are used and can’t seem to find anything that works with PMTRAN.FINPERIODID

Any suggestions?

@RHarrison You don’t actually have to join a table in to get a date parameter. You can add a table to the report which has the parameter type needed, then use the GetFieldSchema() function on this, but this added table does not need to be added to Relations tab.


@RHarrison You don’t actually have to join a table in to get a date parameter. You can add a table to the report which has the parameter type needed, then use the GetFieldSchema() function on this, but this added table does not need to be added to Relations tab.

I’m not adding the table to get period info, just to get the costcodeCD for sorting.

My problem is that the parameter I create seems to be in a different format that PMTRAN.FINPERIODID.

I can’t do basic comparisons like >= or <=.

The only way I can get them to work is if I build variables for both FINPERIODID & my parameter by doing this

$FinPeriodIDYYMM = right( PMTran.FinPeriodID],4)+left()PMTran.FinPeriodID],2)

and

$StartPeriod YYMM =right(@StartPeriod,4)+left(@StartPeriod,2)

Then I can compare the two variables but this seems like a lot of unnecessary work.


Hi @RHarrison were you able to find a solution? Thank you!


Reply