Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Im working on AS400 with IBM iSeries Access , i need to implement the incremental load for one table as following:
load all data except last 30 days from QVD.
load last 30 days data from DB,
the idea is very simple but the main issue is the date filed on DB having speace and i don't know how i can give the right command
the source filed looking like this '101001 ' i try idea by making vairable to give me date before 30 days including the speace but also not work [:(]
any idea plz......!!!
The details are not clear... In general I understand the request is to load data older 30 days from QVD, and 30 days and later from the database. It can be implemented like this:
1. Define the date "30 days back" as a variable
LET v30daysback = date(today()-30);
2. Load from QVD with condition "older than 30 days"
Result:
LOAD
...
FROM file.qvd
WHERE Date < '$(v30daysback)';
3. Load from the database only the fresh data
CONCATENATE (Result) LOAD
...
;
SQL SELECT
...
FROM table
WHERE Date >= '$(v30daysback)';
As for the date formatting - it is an unrelated question, and it is no clear from your post. As Corrado says - need example of your data.
Could you explain better your request?
Even with example data?
Regards
The details are not clear... In general I understand the request is to load data older 30 days from QVD, and 30 days and later from the database. It can be implemented like this:
1. Define the date "30 days back" as a variable
LET v30daysback = date(today()-30);
2. Load from QVD with condition "older than 30 days"
Result:
LOAD
...
FROM file.qvd
WHERE Date < '$(v30daysback)';
3. Load from the database only the fresh data
CONCATENATE (Result) LOAD
...
;
SQL SELECT
...
FROM table
WHERE Date >= '$(v30daysback)';
As for the date formatting - it is an unrelated question, and it is no clear from your post. As Corrado says - need example of your data.
Hi all
first of all sorry for unclear information, and thanks for your replays,,
Daer Michael,
i was doing the same step but the diffrent is very small
,
i was doing like = (where Date>= $(vDay) ) and it was giving me error.
and the correct as you wrote (where Date>=' $(vDay) ')
Thanks A Lot 🙂
Glad it helped ![]()
For future - these sort of mistakes easy to find going through the log file. Log shows actual values of the variables instead of their names. Using debug step-by-step may be usefult too, if the script is not too long.