[ic] SQL sum function in query tag?

Dan Browning interchange-users@icdevgroup.org
Tue Jan 28 12:51:01 2003


At 10:50 AM 1/28/2003 -0600, you wrote:
>I'm wondering if it is possible to do SQL functions within the query tag. 
>My database is MySQL.
>
>On the flypage, I'm passing this code (adds times for track rows to get 
>the total disc time for a CD):
>
>[query sql="select time_format(sum(length), '%T') from music where sku = 
>[item-code]" table=music type=list]
>[list]<p>[sql-param length]</p>[/list]
>[/query]
>
>This gives me nothing. I would guess there's a problem with what I should 
>ask for (sql-param ???). Is this even possible?
>
>Thanks,
>Josh

If that is valid SQL for your table, try [sql-pos 0].  If that works, then 
isn't passing 'length' back as the column header.

--
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
| Dan Browning, Kavod Technologies,      <dan.browning@kavod.com> |
| 6700 NE 162nd Ave, Suite 210, Vancouver, WA (360) 843-4074 x217 |
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
Documentation is like sex: when it is good, it is very, very good; and
when it is bad, it is better than nothing.
                 -- Dick Brandon