List:General Discussion« Previous MessageNext Message »
From:Eric Lommatsch Date:August 22 2007 9:20pm
Subject:RE: Why is the average of an int column returned as a string
View as plain text  
I have tried that and that seems to be working for me. I am just wondering
why all of the sudden queries that were returning the averages as numeric
values as string values.

Thank you for your suggestion.  


Thank you
 
Eric H. Lommatsch
Programmer
360 Business 
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939
Fax 303-778-0378
 
ericl@stripped

-----Original Message-----
From: Rhys Campbell [mailto:rhys.campbell@stripped] 
Sent: Wednesday, August 22, 2007 3:34 AM
To: Eric Lommatsch; mysql@stripped
Subject: RE: Why is the average of an int column returned as a string

You could use the CAST function, although I have just discovered that MySQL
is rather limited in the types you are able to CAST to...

http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html

-----Original Message-----
From: Eric Lommatsch [mailto:EricL@stripped]
Sent: 21 August 2007 22:52
To: mysql@stripped
Subject: Why is the average of an int column returned as a string


Hello,
 
I am working with a query that calculates the averages of survey answers. 
 
The survey answers are stored in the database as int(11) fields. When I run
the query the results that I am getting are being returned as string data. 
 
The query that I am working with is a data source for a Crystal Reports
reports. The average columns that are being returned by the query are used in
the report in fields that have been formatted for double values.
 
I am using MySQL 5.0.18 as the database. What would I have to do to get the
averages of Int columns to return as doubles, rather then having to change
all of my columns to be double columns?
 
Thank you
 
Eric H. Lommatsch
Programmer
360 Business
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939
Fax 303-778-0378
 
ericl@stripped
 

This email is confidential and may also be privileged. If you are not the
intended recipient please notify us immediately by telephoning +44 (0)20 7452
5300 or email postmaster@stripped. You should not copy it or use it for
any purpose nor disclose its contents to any other person. Touch Local cannot
accept liability for statements made which are clearly the sender's own and
are not made on behalf of the firm.

Touch Local Limited
Registered Number: 2885607
VAT Number: GB896112114
Cardinal Tower, 12 Farringdon Road, London EC1M 3NN
+44 (0)20 7452 5300

Thread
Why is the average of an int column returned as a stringEric Lommatsch21 Aug
  • Re: Why is the average of an int column returned as a stringBaron Schwartz22 Aug
    • Re: Why is the average of an int column returned as a stringPaul DuBois22 Aug
  • Re: Why is the average of an int column returned as a stringDan Nelson22 Aug
RE: Why is the average of an int column returned as a stringRhys Campbell22 Aug
RE: Why is the average of an int column returned as a stringEric Lommatsch22 Aug
RE: Why is the average of an int column returned as a stringRhys Campbell23 Aug