Versions des environnements
Network:
Windows 2000 Server
Hi,Borislav
First of all thanks to your help.
*****>First, trying to retrive all datas from JobMaster(JobMast) file with specified
conditions into cursor temp.
*****>Then, trying to sum total Qty and Total Amount from the Transactin file (SoTrs) based on
*****>Qurey result.
*********************************************
and Vfp code here
if ThisForm.chk3mth.value=1
mcond2='month(date())-month(job_salorddt)>3'
else
mcond2='!empty(job_salorddt)'
endif
SalExpDat - Expire date
SalExpPrd - Expire Period(No.of months)
Sele SalOrdDt As sodate, IIF(SalExpDat)>Date(),Gomonth(SalExpDat,SalExpPrd),SalExpDat) As ExpireDate,SalOrdno as sovno, CusCode as cusno, ;
IIF(empty(CusCode),JobCustomer,Customer.Cusname) as cusname,;
Code as jobcode, discount as discamt From jobmast where branch_code= cBranch ;
and !empty(Salordno) and Jobclose#'C' and jobapproval='A' and &mcond2 into cursor temp
Sele a.so_docno as sovno, ;
a.so_qty as qty, a.so_price as rate, a.so_discper as disc, a.so_date, sum((a.so_qty-a.so_bkdqty)*a.so_price) as totprice, ;
sum((a.so_qty-a.so_bkdqty)*a.so_cost) as totcost, b.sodate, b.cusname, b.ref, b.jobcode, b.sman, b.appdt, b.discamt, ;
iif(ttod(a.so_date)>ttod(b.appdt),"N"," ") as newitm ;
from sotrs a, temp b where a.so_docno=b.sovno ;
and a.so_delflag and a.so_qty-a.so_boqty#0 into cursor tempcur group by a.so_docno
Sele tempcur
brow
I want to just convert it into Sql Server Code.
With thanks and regards
Abdulla
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement