SELECT SUM(Cdm30wrk.wrk_tlamt) AS LastYearSales; FROM classicdb!cdm30wrk; WHERE Cdm30wrk.wrk_stat = "A-ACCTNG" ; AND Cdm30wrk.wrk_page = 1; AND Cdm30wrk.cmp_name = lcThisClient; AND YEAR(Cdm30wrk.date_updt) = ldLastYear; into cursor curLastYearSales thisform.pgfClientDetails.pagAccountDetails.txtLastYearSales.value = curLastYearSales.LastYearSales>Please show me why this code returns what it does.
>local ldLastYear, lcThisClient, curLastYearSales > >*** > >ldLastYear = YEAR(DATE()) - 1 >lcThisClient = thisform.cboClientName.Value > > >SELECT SUM(Cdm30wrk.wrk_tlamt); > FROM classicdb!cdm30wrk; > WHERE Cdm30wrk.wrk_stat = "A-ACCTNG" = .T.; > AND Cdm30wrk.wrk_page = 1; > AND ALLT(Cdm30wrk.cmp_name) = lcThisClient; > AND YEAR(Cdm30wrk.date_updt) = ldLastYear; >into cursor curLastYearSales >thisform.pgfClientDetails.pagAccountDetails.txtLastYearSales.value = curLastYearSales >>This code is in the init of the form. Optimistic locking, table buffered private data session.