Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reposting : RDO/Money data type

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello,

I have a strange problem using Money data types in my ASP page.

I am using a RDO Control to display data returned from a stored procedure.

One of the fields is of money data type. But the data never gets retrieved.
If I convert it to float (in the stored proc) and then return, everything works fine.

I am not sure, but I think that RDO does not support Money data types.
I have the latest version of MDAC installed on my PC.


Anyone having any clues???


I am not able to call the FormatCurrency VB function because of the way the data is being displayed.
Below is the code to display the table.
Note: #ADC is the handle to the RDO object.


******************************************************************
<table width=&quot;100%&quot; border=&quot;2&quot; bordercolor=&quot;Gray&quot; bordercolorlight=&quot;Gray&quot; bordercolordark=&quot;Gray&quot; datapagesize=&quot;12&quot; bgcolor=&quot;#C6C6FF&quot; id=&quot;tblDATA&quot; datasrc=&quot;#ADC&quot;>
<TR>
<TD width=25% align=left><SPAN DATAFLD=ShortName></SPAN></td>
<TD width=15% align=center><SPAN DATAFLD=DC></SPAN></td>
<TD width=20% align=right><SPAN DATAFLD=CurrComm></SPAN></td>
<TD width=20% align=right><SPAN DATAFLD=Outstanding></SPAN></td>
<TD width=20% align=right><SPAN DATAFLD=Available ></SPAN></td>
</TR>
</table>


**************************************************************


As you can see, I am not able to call the VBScript function here. Any other way of displaying data?


Cheers
Thumbesh
 
Ahh I see. Why don't you try to set the datatype as numeric(9) with the scale = 2 this would give you 2 decimal places.
 
Hi,

The reason I want is - to get the $ symbol along with the thousand separators. I can convert to varchar - but then I cannot sort on the money field. It would be better if I provide sort on money field, as there are more than one money fields.

 
RDO is just a programming interface, which exposes set of objects and methods to get and manipulate data from a database. It doesn't care about datatypes being retrieved.
From the piece of code you've presented not clear what kind of problems you're having with money datatype, but if you don't have any problems with float, then you can just format output, using formatcurrency function:

do while not objRS.eof
response.write formatcurrency(objRS(&quot;price&quot;),2) &amp; &quot;<br>&quot;
objRS.movenext
loop

Of course, this is just a general idea.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top