INVOICE .itrlink>I have trying to get some fields from the table detail. If has 2 tables linking to it, a live transaction file and a historical transaction file. When I run this I get an error saying that the alias history is not found
>select LiveDetail.ide_key ; > , LiveDetail.idelink ; > , LiveDetail.stkref ; > , LiveDetail.desqty ; > , LiveDetail.linavgc ; > from INVOICE ; > join DETAIL as LiveDetail on INVOICE .itrlink = LiveDetail.idelink ; > where INVOICE .period >= 201801 ; > and INVOICE .stage = "70" ; >union ; > select HistDetail.ide_key ; > , HistDetail.idelink ; > , HistDetail.stkref ; > , HistDetail.desqty ; > , HistDetail.linavgc ; > from HISTORY ; > join DETAIL as HistDetail on HISTORY.itrlink = HistDetail.idelink ; > where HISTORY.period >= 201801 ; > and HISTORY.stage = "70" ; > into cursor TempCursor >