Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Money Value gets truncated w/ADO


Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2002, 12:50 AM
blabore blabore is offline
Regular
 
Join Date: Jan 2002
Location: Austin, TX
Posts: 83
Default Money Value gets truncated w/ADO


I have a column of type "money" in a SQL Server database table I need to use in a report. I can retrieve the value using ADO recordsets and insert it into the report (a word document) without any problems, but I have a problem with even values (such as exactly 10.00 etc.). Instead of of the recordset field returning 10.00, it returns the integer 10. Is there some SQL syntax I can add to my query to force it to display 2 decimals? Any help would be appreciated.
__________________
-Ben LaBore
Reply With Quote
  #2  
Old 05-02-2002, 07:19 AM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

I don't believe this is possible. You need to format the value after
you retrieve it from the recordset.
__________________
Posting Guidelines
Reply With Quote
  #3  
Old 05-02-2002, 08:45 AM
Huby's Avatar
Huby Huby is offline
Regular
 
Join Date: Apr 2002
Location: brussels, belgium
Posts: 69
Default

just display all values with 2 decimals using the format statement

Code:
.Selction.Typetext Text:= Format(RecSet("Price"), "0.00")
or
.Selction.Typetext Text:= Format(RecSet("Price"), "currency")
Reply With Quote
  #4  
Old 05-02-2002, 03:22 PM
blabore blabore is offline
Regular
 
Join Date: Jan 2002
Location: Austin, TX
Posts: 83
Default

Thanks guys for the help. I'll try to format it in Word as you suggested or use the FormatNumber function in VB.
__________________
-Ben LaBore
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->