I have a table applicants and one of the columns is age, i want to be able to calculate the age range, frequency and variation. Is there a way this can be achieved?
lilwizz770 0 Newbie Poster
Recommended Answers
Jump to PostThe problem with 'age' columns is that they 'age'. Haw haw. Seriously, they're out of date as soon as you insert them. You should have a date of birth and calculate the age from that when required.
The functionality you require is possible. However, you may find it easier to …
Jump to PostHere are a few examples of pasted-up functions:
function mean($data) { $count = count($data); $sum = array_sum($data); return $sum / $count; } function variance($data, $precision= NULL) { $totalAbsoluteDiffs = array(); $mean = mean($data); foreach($data as $item) { $totalAbsoluteDiffs[] = pow(($item - $mean),2); } if($precision && is_int($precision)) { …
All 5 Replies
phorce 131 Posting Whiz in Training Featured Poster
mmcdonald 28 Posting Pro

diafol
mmcdonald 28 Posting Pro

diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.