I have a VIEW in sql server and I need to get data to foxpro using date range. Below is my codes that I used,
SQL SERVER viwe vInvFinal,
And I have a foxpro form which has two texboxes to insert start date and end date. I used below code to get data from sql to foxpro.
I need my cursor like this,
Here I don't want to get data from cSggNo which is .NULL
How can I make my code to do this?
Thank you.
SQL SERVER viwe vInvFinal,
Code:
cSggNo cInvNo cProdFty cHTSCode nInvQty dXFactory
SGG0945 S1490 FTM 10.14 234 2021-04-24 00:00:00.000
SGG0945 S1490 FTM 10.14 12 2021-04-24 00:00:00.000
SGG0945 S1490 FTM 10.14 743 2021-04-24 00:00:00.000
SGG0941 S1486 SFC 601 100 2021-04-15 00:00:00.000
SGG0941 S1486 SFC 601 25 2021-04-15 00:00:00.000
SGG1050 S1694 GML 345.23 456 2021-04-28 00:00:00.000
SGG1050 S1694 GML 345.23 874 2021-04-28 00:00:00.000
.NULL S1854 GML 31 12 2021-04-10 00:00:00.000
.NULL S1854 GML 31 12 2021-04-10 00:00:00.000
And I have a foxpro form which has two texboxes to insert start date and end date. I used below code to get data from sql to foxpro.
Code:
stra="SELECT cSggNo,cInvNo,cProdFty,cGMTName,cHTSCode,SUM(nInvQty),dXFactory FROM MIS.dbo.vInvFinal WHERE "
stra=stra+"dXFactory>=?thisform.txtFromDate.Value AND dXFactory<=?thisform.txtToDate.Value and cSggNo='isnull' group by cInvNo"
SQLEXEC(hndOps,stra,'SGG')
I need my cursor like this,
Code:
cSggNo cInvNo cProdFty cHTSCode nInvQty dXFactory
SGG0945 S1490 FTM 10.14 989 2021-04-24 00:00:00.000
SGG0941 S1486 SFC 601 125 2021-04-15 00:00:00.000
SGG1050 S1694 GML 345.23 1330 2021-04-28 00:00:00.000
Here I don't want to get data from cSggNo which is .NULL
How can I make my code to do this?
Thank you.