[AccessD] Converting a string to a double in an SQL query.

Michael Tucker mtucker at myrealbox.com
Tue Jul 1 12:16:53 CDT 2003


Hi everyone,

I'm dealing with an Access Project that is connecting to an SQL Server
database.  I'm trying to produce a query (and a report that reads this
query) to totals a billing amount.  Simple stuff, right?  Well, the designer
of the database decided to make the data type of the BillingAmount field a
string (specifically varchar(15)), thus I cannot sum this field.

I've been trying to create a calculated field in my query that just converts
the BillingAmount field to a number using the function
"CDbl(dbo.Transactions.BillingAmount)".  When I try to run the query however
I get the "CDbl is not a valid function" error.

This would be easy stuff if I were messing with native Access tables but
since these are SQL Server tables then I'm a little out of my experience.
Anyone know how I can do what I'd like to do here?

Thanks.



More information about the AccessD mailing list