|
Hi JeffYou have misplaced the parenthesis in the 5th parameter of the following statement:
Rc = SQLBindCol( Stmt : 6 : SQL_DECIMAL : %Addr(Row(1).AvgTyr ) : %Len(Row(1).AvgTyr * 256) + %DecPos(Row(1).AvgTYr) : F6) ; You don't want %len(x*256)! you want %len(x) * 256.The former statement says "how big of a variable would I need to store the result of x*256?" The latter says "how big of a variable is x? Multiply that by 256."
For example, if x is a 5,2 field containing 500.00. %len(500 * 256) = 6 (since 500*256 = 128000 which is 6 digits) however, %len(x)*256 = 1280 since %len(x)=5, and 5*256 = 1280.
To fix your code, move the parenthesis so you're multiplying the result of the %LEN BIF by 256 instead of multiplying the input to the %LEN BIF. For example:
: %Len(Row(1).AvgTyr) * 256 + %DecPos(Row(1).AvgTYr)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.