Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    17
    Plugin Contributions
    0

    Default Cool Idea/Question About Demographic Add-ons

    This may be ridiculous, forgive me if it is or this already exists.

    My goal/idea is to have a way to extract demographic summaries about the customers in my store. At the very least to get average age based on DOB.

    Does anyone know of an add-on that does this?

    Does anyone know of a way to export the info I would need to compute the avg age without having to look at each customer record to transcribe the DOB?

    Thanks!

  2. #2
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: Cool Idea/Question About Demographic Add-ons

    use a sql-statement like
    PHP Code:
    SELECT AVG((YEAR(CURDATE())-YEAR(customers_dob)) - (RIGHT(CURDATE(),5)<RIGHT(customers_dob,5))) AS age 
    FROM zen_customers WHERE customers_dob 

    OR
    PHP Code:
    SELECT AVG(DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(customers_dob)), '%Y')+0) AS age
     FROM zen_customers WHERE customers_dob 
    0
    MYSQL::http://dev.mysql.com/doc/refman/5.0/...culations.html
    Last edited by hugo13; 19 Nov 2008 at 08:04 AM.

 

 

Similar Threads

  1. idea: Open Source Easy Add-Ons Install Tools
    By epit in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 24 Dec 2010, 12:36 AM
  2. First time upgrader general question about handling add ons
    By RoPey in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 9 Jun 2010, 09:44 AM
  3. Confused about installing add-ons
    By invision in forum General Questions
    Replies: 3
    Last Post: 1 Apr 2008, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg