CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> Archive -> GotoCode Archive

 Finding an average

Print topic Send  topic

Author Message
Posted: 11/17/2003, 6:47 AM

I have a column age that takes a persons birthday and converts it to the persons age. I need to find the average of all the ages. I tried the CDDLookUp function as pointed out in the tips and articles but that is for .asp and I cannot seem to get it to work in .php. Any ideas would be appreciated.

This is the code just to get the sum, which does not work.

//DLookup @69-3D654DBA
global $DBConnection1;
global $HR_EMP;
$result = CCDLookUp(SUM(Age), TABLE1, "", $DBConnection1);
$result = intval($result);
//End DLookup

Posted: 11/17/2003, 9:55 AM

While they do not directly address your problem the tutorials in this category may help you.

Hope this helps

RexDesign CodeCharge Studio Tutorials
Steve Kitchen
Posted: 11/17/2003, 3:04 PM

If you code your query as

$result = CCDLookUp('SUM(Age) AS Age', TABLE1, "", $DBConnection1);

you should get the result you expect. I came across the same problem & solved it this way ...




These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.