The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Trouble with the Money field type
Posted: 13 Feb 08 10:59 AM
|
Using SalesLogix v6.2.6
I run a SELECT statement for the "Balance" field, which is a money type. It is stored in the database as "740.0000" but SalesLogix displays something totally different each time I run the statement. I've gotten alternating values of "197032483697.4592" and "168884986026.3936."
Can someone explain what may be happening? I need to get the "740" and not those other crazy values!
Thanks in advance for looking in to this!
|
|
|
| |
|
Re: Trouble with the Money field type
Posted: 13 Feb 08 2:39 PM
|
My statement reads:
SELECT BALANCE FROM JDE_ARSUMMARY
This statement is stored in a variable, which is used in a recordset object in my SalesLogix script. The BALANCE field is a money type. |
|
|
|
Re: Trouble with the Money field type
Posted: 13 Feb 08 3:28 PM
|
This is very difficult to troubleshoot without knowing more information.
When you have the balance figure, what are you trying to do with it? Is is just something that you are displaying on an account form (for example)?
SELECT BALANCE FROM JDE_ARSUMMARY where AccountID = 'zzzzzzzzzzzz'
Are you displaying the result using a text box? Have you set the format type property of the text box? |
|
|
|
Re: Trouble with the Money field type
Posted: 13 Feb 08 4:00 PM
|
The project contains a check list box that lists record numbers and account balances. When the user checks a box, an e-mail preview is generated. The e-mail message is displayed in a SalesLogix browser control; it contains the record number, the balance, and other HTML formatting. The user will click a button to send multiple e-mails to their recipients. I believe SalesLogix may be converting the money field and expressing it in another format, but I may be wrong. Here is the part of the code that first uses the BALANCE field:
_________________________________________
Dim strSQL, rsJDEARSummary, nrecords
strSQL = "SELECT JDE#, BALANCE " &_ "FROM JDE_ARSUMMARY " &_ "WHERE AG_61TO90 > 0 " &_ "ORDER BY JDE#"
'Get the number of JDE records Set rsJDEARSummary = Application.CreateObject("ADODB.Recordset") rsJDEARSummary.ActiveConnection = Application.GetNewConnection rsJDEARSummary.Open(strSQL) nRecords = rsJDEARSummary.RecordCount
'Only show interface if there is at least one record If nRecords > 0 Then clbColEmail.Clear
For i = 0 To nRecords - 1 clbColEmail.Items.Add "JDE: " & Trim(rsJDEARSummary("JDE#").Value) & ", " &_ "Balance: " & Trim(rsJDEARSummary("Balance").Value) Next _________________________________________
|
|
|
|
Re: Trouble with the Money field type
Posted: 13 Feb 08 4:08 PM
|
So the format of the numbers is wrong in the clb?
Have you tried going into debug and inspecting the value of rsJDEARSummary("Balance").Value as the resultset is traversed?
At least, then, you can reassure yourself that the data retrieval part is working correctly. |
|
|
|
Re: Trouble with the Money field type
Posted: 14 Feb 08 7:36 AM
|
The format of the number was wrong before it gots to the clb. I tried changing the field type to decimal, and then everything worked fine. I switched it back to money, and I still get the results I want. I still don't know what was going on or why this worked, but I'm statisfied now. Thanks for stepping in and trying to help, Phil.  |
|
|
| |
|