*-- Part 1: Select
lcSelect = "Select ap_g.ven_numb, ap_g.voc_numb, ap_g.voc_type, " +;
"ap_g.due_days, ap_g.dis_days, ap_g.trn_date " +;
"000000000.00 as ag4_totl, 000000000.00 as tot_bala " +;
"FROM ap_g " +;
"LEFT OUTER JOIN ap_a " +;
"ON (ap_g.ven_numb = ap_a.ven_numb) "
lcWhere = "WHERE 0=0 "
IF ThisForm.chkShow_Past_Periods.Value = 0
lcWhere = lcWhere + " AND ap_g.voc_stat <> 1 "
ENDIF
IF Thisform.opgRpt_Sort.Value = 1
lcOrderBy = " ORDER BY ap_a.ven_name, ap_g.voc_numb "
ELSE
lcOrderBy = " ORDER BY ap_g.ven_numb, ap_g.voc_numb "
ENDIF
lcOrderBy = " ORDER BY ap_g.ven_numb, ap_g.voc_numb "
lcSQL = lcSelect + lcWhere + lcOrderBy
PRIVATE lcFile
lcFILE = SYS(2015)
x=SQLEXEC(gnC, lcSQL, lcFile)
IF x< 0
set step on
ENDIF
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only