Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Formating an AsString value from ADO query

3 views
Skip to first unread message

Mike Collins

unread,
Mar 19, 2008, 9:13:27 AM3/19/08
to
Hi all, got a really simple question but can seem to find the right
function.

I have an MS Access database with a table that has two fields which are set
a Decimal values. I run an ADO query to get all the values from the table
and I want to assign the returned information into a comma-delimited string
list.

My problem is that when I use the AsString i.e.
quStaffInfo->FieldByName("rateOfPay")->AsString the value does not get
converted correctly. For example, if I have a value of 43.00 in the
database, when I use AsString, the value gets returned as 43. without the
precision. If I have a value of 0.10 I get .1 returned.

It may be that Access is returning these values in this format, but
displaying them differently when I examine the contents in Access.

Can anyone point me in the right direction to convert this correctly and
maintain the format that I need?

Many thanks in advance,

Mike C


Mike Collins

unread,
Mar 19, 2008, 9:25:08 AM3/19/08
to
Please ignore, I've just found FloatToStrF which does the job nicely - sorry
for the wasted post...

Mike C


brendan....@gmail.com

unread,
Apr 22, 2008, 5:11:59 PM4/22/08
to

By no means is this post wasted. I learned something new today

0 new messages