Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting the Maximum value of a field in the script

Hi everyone!

In the LOAD script, I have this...

---------------------------------------------------------------------

transactions:

transID,

transNo,

transCalendarDate,

transFiscalDate;

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

---------------------------------------------------------------------

Now, after loading everything to "transactions", what I wanted to do through script is to:

1. assign the maximum transCalendarDate to a variable vMaxCal

2. assign the maximum transFiscalDate to a variable vMaxFiscal

Advance thank you for all of your replies!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Transactions:

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

Temp:

load

    max(trn_calendarDate) as maxCDate

    ,max(trn_FiscalDate) as maxFDate

resident Transactions;

LET vMaxCal = peek('maxCDate');

LET vMaxFiscal = peek('maxFDate');

drop table Temp;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Transactions:

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

Temp:

load

    max(trn_calendarDate) as maxCDate

    ,max(trn_FiscalDate) as maxFDate

resident Transactions;

LET vMaxCal = peek('maxCDate');

LET vMaxFiscal = peek('maxFDate');

drop table Temp;


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert!!!