CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Finding an average

Print topic Send  topic

Author Message
OIGweb
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);
$HR_EMP->avg->SetValue($result);
//End DLookup

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

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

http://www.rexdesign.com/ccs/kb.php?language_id=7&category_id=42

Hope this helps
Greetings
Dave

RexDesign CodeCharge Studio Tutorials
http://www.rexdesign.com/ccs/default.php
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 ...

Rgds,

Kitch


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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