Danny, not sure If you are asking for the SQL to pull distinct values from a character field (i.e. people can put in whatever value they want) Or if you are looking for values in a Selection field (i.e. in the admin tool, open the field up, look on the database tab, and the Data Type: says "Selection" If you are looking for those values you can run the following query to get them:
Select ev.enumid, ev.value from field_enum_values ev Inner join Field f ON ev.fieldid = f.fieldid Inner Join arschema s ON s.schemaid = f.schemaid Where s.name = 'FORM_NAME' AND f.fieldname = 'DATABASE_FIELD_NAME' That should give you a list of values from an enumerated/selection field. HTH Matt P. From: Action Request System discussion list(ARSList) [mailto:[email protected]] On Behalf Of Joe DeSouza Sent: Monday, February 02, 2009 8:17 AM To: [email protected] Subject: Re: SQL to get counts on distinct values ** Danny, Select distinct count(Selection_field) from Table; Joe ________________________________ From: Danny Kellett <[email protected]> To: [email protected] Sent: Monday, February 2, 2009 9:08:08 AM Subject: SQL to get counts on distinct values ** Hi All, Anyone have the sql that would give me a count of every distinct value in a selection field? Many thanks Danny __Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are" html___ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are"

