vba - DSum and Sum returning wrong values -


so trying sum column of table. column has values of 1, 0 or -0.25 , 40 rows. results should smallish. instead, i'm getting results 4080, 40920, 44440, 88880 , other crazy numbers.

this how i'm calling it:

sum = dsum(fld.name, tablename) 

i'm looping through each field in table, fld.name column name, , tablename table name.

i tried

select sum(colname).... 

but gave me same large values.

what doing wrong here?

edit: apparently returning field name multiplied number of rows. 102 (colname) times 40 rows = 4080. weird!

it sounds field name being mistaken number, try instead:

sum = dsum("[" & fld.name & "]", tablename) 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -