Currency field data not displaying properly

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Currency field data not displaying properly

Post by Japhar » Fri 09 Mar 2007 13:42


I have created a new project where i have one MSConnection, MSQuery, Datasource, DBText field and one button on my screen.

MSQuery: select 0.00 as total from salary
added total to persistance field and Readonly property of total is set to False.

Note: Here total column will not available in salary table. I'm just retriving 0.00 and data i will manipulate from the code.

DBText field: attached Datasource and DataField as 'total'

Now on click of the button, i have written below code:

MSQuery.FieldByName('total').AsCurrency := 1000.00;

Once the above code is executed it is showing '1E3' instead of $1000.00
If i assign below 100 to total column then it shows properly.

Why this inconsistency? Please suggest me how to proceed???

FYI: This is one of my requiement in my migration code from IDAC to SDAC.

Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Mon 12 Mar 2007 08:57

Please modify your query as the following and try again:

Code: Select all

select CAST(0.00 as money) as total from salary

Posts: 38
Joined: Thu 05 Oct 2006 04:22

Post by Japhar » Mon 12 Mar 2007 15:03

Great...It works...thanks a lot...

Post Reply