[AccessD] Bug in access

David McAfee davidmcafee at gmail.com
Tue Nov 10 13:36:14 CST 2009


Oops, you are correct. It still works for me

SELECT CDbl("123.45") AS Expr1, tblMyTable.CPName, CDbl([CPName]) AS Expr2
FROM tblMyTable;


Expr1	CPName	        Expr2
123.45	David McAfee    #Error	
123.45	Bill Gates          #Error	
123.45	Larry Ellison     #Error	
123.45	Megan Fox      #Error	
123.45	123.45	123.45
123.45	678.90	678.9


On Tue, Nov 10, 2009 at 11:06 AM, Charlotte Foust
<cfoust at infostatsystems.com> wrote:
> Did I miss something or did you guys?  I understood that John was specifically trying to use CDbl against a field name, not an explicit string.  Is that correct, JC?
>
> Charlotte Foust
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee
> Sent: Tuesday, November 10, 2009 11:02 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Bug in access
>
> John, creating a query such as:
>
> SELECT CDbl("123.45") AS Expr1, tblMyTable.Name FROM tblMyTable;
>
> Expr1   Name
> 123.45  David McAfee
> 123.45  Bill Gates
> 123.45  Larry Ellison
> 123.45  Megan Fox
>
> As well as performing this in the immediate window, both work for me:
> ?cDbl("123.45")
>  123.45
>
>
>
>
> On Tue, Nov 10, 2009 at 10:09 AM, Heenan, Lambert <Lambert.Heenan at chartisinsurance.com> wrote:
>> There has to be more to this than meets the eye.
>>
>> The following SQL runs just fine for me, I Access 2003.
>>
>> SELECT CDbl("123.45") AS SomeDouble, BankNames_tbl.BankID FROM
>> BankNames_tbl;
>>
>> Decompile your front end?
>>
>> Lambert
>>
>>
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
>> Sent: Tuesday, November 10, 2009 12:30 PM
>> To: Access Developers discussion and problem solving
>> Subject: [AccessD] Bug in access
>>
>> I am working on a project where I use a table to dynamically build a query.  The table has field names in it, and I can just append those field names into a select string and voila, it works.
>> place the field names you want in the table and a select statement is created of those fields.  This system is shuffling fields around from scanned documents (CSV files) to get them into a standard order.
>>
>> OK, so I can also use entire functions such as format(Field1,"000.00") and that works.  cSng(Field1) works.  cDbl(Field1) does NOT WORK.  It complains that the function cDbl needs two parameters, but if I supply anything in the second parameter, then cDbl works (no longer complains) but returns a zero.
>>
>> To test this bug, create an aliased field in a query something like
>>
>> Select cDbl("123.45") as SomeField, etc etc
>>
>> The QBE will immediately complain about cDbl needing another
>> parameter.  Try the same thing with
>> cSgl("123.45") and it works just fine.  NOTICE that cDbl() in the debug window does NOT require another parameter and if you try to provide one, it will fail to execute.
>>
>> The bugs we have to work around.  Sigh.
>>
>> But hey, we have a shiny new tool bar.  ;)
>>
>> --
>> John W. Colby
>> www.ColbyConsulting.com
>> --
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list