Topic: Error
Can any one tell about this kind of attached pic? How it come up and what is its sulution?
My Visual Database → General → Error
Can any one tell about this kind of attached pic? How it come up and what is its sulution?
Hello unforgettable
How difficult to answer you.
Let us know under what conditions this appears:
SQL query, calculation between several values, variable definition error...
There can be several explanations.
Give us an example of your project and tell us after which operation this occurs.
JB
It appear while calculation between several values.
When values from corresponding field is empty.
To re-iterate what JB has written, without seeing your project, you are very unlikely to get any sort of help.
Derek.
Hi derek,
I got this kinf of error " could not convert variant of type(unicodestring) into type(double) by typing following script.
Reception.Edit1.Value:= SQLExecute('Select Sum((Advance)+(Received)) from Fees Where Date(sdate1) = "' + FormatDateTime('YYYY-MM-DD',Reception.dtp.DateTime) + '"');
Reception.Edit2.Value:= SQLExecute('Select Sum((paid)+(lpaid)) from Expenses Where Date(date1) = "' + FormatDateTime('YYYY-MM-DD',Reception.dtp.DateTime) + '"');
Reception.Edit3.Value:= SQLExecute('Select Sum((Advance)+(Received)) from Fees Where Date(sdate1) = "' + FormatDateTime('YYYY-MM-DD',Reception.dtp.DateTime) + '"')-SQLExecute('Select Sum((paid)+(lpaid)) from Expenses Where Date(date1) = "' + FormatDateTime('YYYY-MM-DD',Reception.dtp.DateTime) + '"');
any solution?
I think you have to change edit.value to edit.text or vartostr(sqlquery)
Try both options
I tried edit.value to edit.text but still I got that error message. Can you tell about other option vartostr(sqlguery)?
bllackpearl is right.
Replace
Reception.Edit1.Value on Reception.Edit1.Text
Reception.Edit2.Value on Reception.Edit2.Text
and modify last
Reception.Edit3.Value:= Reception.Edit1.Value - Reception.Edit2.Value;
OR
Reception.Edit1.Value:= SQLExecute('Select IFNULL(Sum((Advance)+(Received)),0) from Fees ...
Reception.Edit2.Value:= SQLExecute('Select IFNULL(Sum((paid)+(lpaid)),0) from Expenses ...
and modify last
Reception.Edit3.Value:= Reception.Edit1.Value - Reception.Edit2.Value;
In addition, SQLExecute is a very simple function and can only output one result.
If the result contains several values, only the first one will be returned, which will be an error.
Thank you every one.
It works correctly. Can you explain this error in some detail, sparrow?
The returned result can be NULL, which results in an error.
Solutions two
1 Use (edit1.text ...)
2 Exclude possibility of NULL result in SQL query IFNULL ( ,0)
Hi sparrow,
Thank you sparrow to guide.
My Visual Database → General → Error
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi