Topic: trying to convert sqllite to mysql
I got an example right here on the forum very good. but i am having difficulty converting from sqllite to mysql
this is part of code.
If Form1Button = 'Purchase Refund' then
Begin
//////////////////////////////////////////////////////////////////////////////////
// Check to make sure that purchase refunds are not greater than the original purchase qty,
// This is checked when issuing a new refund on a purchase transaction.
//////////////////////////////////////////////////////////////////////////////////
PurchQtyVar := SqlExecute('Select Qty From PurchInv Where record_count = ' + Comprar_add.EditCounter1.Text + ' and id_DbCr = 3');
TotRefundVar := SqlExecute('Select SUM(Qty) From PurchInv Where record_count = ' + Comprar_add.EditCounter1.Text
+ ' and id_DbCr = 5');
If QtyVar + TotRefundVar > PurchQtyVar then
Begin
MessageBox('Refund qty will cause total refunds to be greater than the original purchase qty.','Error',MB_OK+MB_ICONERROR);
Comprar_add.edPurchInvQty.SetFocus;
Cancel := True;
Exit;
End;
error is.
could not convert variant of type (null) into type (integer)
this is line error
TotRefundVar := SqlExecute('Select SUM(Qty) From PurchInv Where record_count = ' + Comprar_add.EditCounter1.Text
+ ' and id_DbCr = 5');