I have a combo box and there have 3 records such as,
[ul]
[li]All GRN[/li]
[li]Completed GRN[/li]
[li]Pending GRN[/li]
[/ul]
Now I want to get records from my MSSQL tables using these 3 records. For that I used like this code. But this is not working.
How can I get records into my cursors using this logic?
Thank you
[ul]
[li]All GRN[/li]
[li]Completed GRN[/li]
[li]Pending GRN[/li]
[/ul]
Now I want to get records from my MSSQL tables using these 3 records. For that I used like this code. But this is not working.
Code:
IF !EMPTY(thisform.cboReportType.DisplayValue) then
IF (thisform.cboReportType.Value = 'Pending GRN') then
stra="SELECT cBatchNo, cAdvanceRef, dAdvanceDate, cFactAccno FROM MAS.dbo.Acp_AdvancePayment where "
stra=stra+" Acp_AdvancePayment.dAdvanceDate>= ?thisform.txtFrom.Value AND Acp_AdvancePayment.dAdvanceDate<= ?thisform.txtTo.Value"
SQLEXEC(hndOps,stra,'_Pending')
ENDIF
IF (thisform.cboReportType.Value = 'Completed GRN') then
stra="SELECT cBatchNo, nPaymentTypeID, cPaymentNumber, dPaymentDate FROM MAS.dbo.Acp_FinalPayment where "
stra=stra+" Acp_FinalPayment.dPaymentDate>= ?thisform.txtFrom.Value AND Acp_FinalPayment.dPaymentDate<= ?thisform.txtTo.Value"
SQLEXEC(hndOps,stra,'_Completed')
ENDIF
IF (thisform.cboReportType.Value = 'All GRN') then
stra="SELECT cBatchNo, nPaymentTypeID, cPaymentNumber, dPaymentDate FROM MAS.dbo.Acp_Batch where "
stra=stra+" Acp_Batch.dPaymentDate>= ?thisform.txtFrom.Value AND Acp_Batch.dPaymentDate<= ?thisform.txtTo.Value"
SQLEXEC(hndOps,stra,'_All')
ENDIF
ENDIF
How can I get records into my cursors using this logic?
Thank you