Sum of BCD Fields returning when using clientdataset binary file

Sum of BCD Fields returning when using clientdataset binary file

Post by dannuli » Wed, 13 Aug 2003 07:03:01

I am having a strange problem related to clientdataset
with the summing of bcd fields in sql server that I haven't found in
the newsgroups.
Let me explain.....

I am using Delphi 6.0 (Build 6.240).

I create the following table on either SQL 2000 or SQL 7...

Create Table TestBCD (TestField numeric(19,2) not null)

and run the following statements...

Insert Into TestBCD Select 1.43
Insert Into TestBCD Select 0.22

Now, I drop a TADOQuery on a form with the following SQL...

Select Sum(TestField) From TestBCD

I hook a TDataSetProvider to that TADOQuery and a TClientDataSet to
that provider. If I open the TClientDataSet, the value 1.65 is
returned, as expected. If I open the clientdataset, and run the

ClientDataSet1.SaveToFile('c:\test.bin', dfbinary);

I now have the clientdataset saved as a binary.

If I drop another clientdataset onto the form and set the filename to
'c:\test.bin' and activate it, the value 0 is returned.

Even stranger is that if I save the file using dfXML, the
clientdataset correctly displays 1.65 when the file is loaded.

Another strange thing is that if I use the SQL text

Select convert(numeric(19,2), Sum(TestField)) From TestBCD

everything works fine.

I have run into the problem using 2 different versions of midas.dll

Anyone have any thoughts/ideas??


1. (8-bit binary to two digit bcd) or (8-bit binary to two digit seven segment)

2. BCD: who or what creates the BCD file?

Hi. I have a technical questions

During Vista installation process, who or what creates the BCD file? Can I
find specific windows application that works during OS installation in order
to generate the BCD file containing information on active patition to boot?

After Vista installation, If BCD need to be repaired (trough Vista DVD)
because the active OS partition is not indicated in BCD file, what does it
means? What kind of problem occurred during installation?


3. How can I filter a Master ClientDataSet from the Detail ClientDataset field values ?

4. using the expression =Sum([field]) returns #error, why?

5. Return Sum in one field for all records with another field in comm

6. Return Sum in one field for all records with another field in

7. Using C code to return a binary file from a CGI function?

8. A way to access Access tables with memo fields using ClientDataset and ADOExpress?

9. Binary Coded Decimal (BCD) how to convert???

10. binary to BCD assistance

11. Convering 2 Bytes of binary to BCD

12. Binary to BCD in VHDL

13. 8 bit binary to 2 digit BCD

14. Converting Binary Fractions to BCD

15. fast binary to BCD source code