Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Limit script loading using variables or other solution ??

I need to limit the data loaded. It has to be limited by year.

I created this:

let $YearFrom = input('Year from', 'Specify the first reporting year required');
if (isnull($YearFrom)) then
let $YearFrom = 1999;
end if ;

which nicely creates the variable $YearFrom.

I want to use the result of this input box to limit the load

This does not work:


LOAD
applymap('Date_map_Billing', DATE) as Billing_Date,
Month(applymap('Date_map_Billing', DATE)) as Billing_Month,
Year(applymap('Date_map_Billing', DATE)) as Billing_Year;
SQL SELECT * FROM Billing where Billing_Year > $YearFrom;

I'm lost in the world of sql.

How can I correctly use the value from the variable in limiting the load?

Your help is much appreciated!!

1 Solution

Accepted Solutions
Not applicable

Michiel try this

LOAD
applymap('Date_map_Billing', DATE) as Billing_Date,
Month(applymap('Date_map_Billing', DATE)) as Billing_Month,
Year(applymap('Date_map_Billing', DATE)) as Billing_Year;
SQL SELECT * FROM Billing where Billing_Year > $($YearFrom);

Talha





View solution in original post

3 Replies
Not applicable

Michiel try this

LOAD
applymap('Date_map_Billing', DATE) as Billing_Date,
Month(applymap('Date_map_Billing', DATE)) as Billing_Month,
Year(applymap('Date_map_Billing', DATE)) as Billing_Year;
SQL SELECT * FROM Billing where Billing_Year > $($YearFrom);

Talha





Michiel_QV_Fan
Specialist
Specialist
Author

SQL error: No value given for one or more required parameters.
Script line: SELECT * FROM txBilling where Billing_Year >2002
SQL SELECT * FROM txBilling where Billing_Year >2002

Michiel_QV_Fan
Specialist
Specialist
Author

OK, this work. I get the error because the number formats aren't correctly defined.

Thanks Talha. Appreciate this very much!