[ic] SQL sum function in query tag?

interchange-users@icdevgroup.org interchange-users@icdevgroup.org
Tue Jan 28 12:40:01 2003


> 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?
>


You might check you sql query in MySQL. I am pretty sure that sku is a
string field, so your query should have quotes around the item code,
sku='[item-code]'

Matt