Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have the following problem:
I want to load a table with a date Variable from another table. So I think the script must be something like this:
Load
Date
from TABLE A;
set vLOADDATE = Date;
Load
DATE_PRICE,
*
from TABLE B where DATEPRICE = $(vLOADDATE)
But when I make it like this the vLOADDATE is empty.
Can anyone help me?
Thanks!
If you want to assign a single record value of field Date to a variable, you need to use inter record functions like Peek().
For example, to retrieve the first Date field value in your [Table A] table:
LET vLOADDATE = Peek('Date',0,'TABLE A');
or to get the last record value:
LET vLOADDATE = Peek('Date',-1,'TABLE A');
Depending on the Date format, you would then need to use
Load
DATE_PRICE,
*
from TABLE B where DATEPRICE = '$(vLOADDATE)';
If you want to assign a single record value of field Date to a variable, you need to use inter record functions like Peek().
For example, to retrieve the first Date field value in your [Table A] table:
LET vLOADDATE = Peek('Date',0,'TABLE A');
or to get the last record value:
LET vLOADDATE = Peek('Date',-1,'TABLE A');
Depending on the Date format, you would then need to use
Load
DATE_PRICE,
*
from TABLE B where DATEPRICE = '$(vLOADDATE)';
Thanks! It works