I have to tables witch I load into QV but befoe loading I whanted some types of records not to be loaded, but the controling field is on another table. The script I have is this one:
LOAD "mvs_ano",
"mvs_periodo",
"mst_seq",
"scd_cod",
"sar_cod",
"trc_cod",
"ntr_cod",
"mvs_qtd",
"mvs_vlcusto",
"mvs_vlvnd",
"mvs_docint",
"mvs_docext",
"mvs_dtdoc",
"mvs_dtmov",
"arm_cod",
"mvs_utlz",
"mvs_prcusto",
"mvs_prvnd",
"mvs_data",
"arm_destino";
SQL SELECT *
FROM PUB."st_movim";
Left Join
LOAD "mst_seq",
"mst_codart",
"mst_descr1",
"mst_descr2",
"mst_codest",
"mst_marca";
SQL SELECT "mst_seq",
"mst_codart",
"mst_descr1",
"mst_descr2",
"mst_codest",
"mst_marca"
FROM GEST001.PUB."st_mestr";
.....
And I whanted to import from "st_movim" table only specific "mst_codest" records I don't know much of SQL so how can this be arrenged so the relation is made before importing data.
I have another problem from the records I import I whanted to have de last value "mvs_prcusto" for sar_code=XX and records ordered by "mvs_data", I tried to look at the sintax of FirstSortedValue(), but I don't understand the parameters, and in this case i wanted the lastsortedvalue.