[ic] Query for count on column

Mark Johnson mark at endpoint.com
Thu Aug 17 07:51:58 EDT 2006

Tim Good wrote:
> Can someone please tell why this code snip will not work:
> I have also tried:
> [query sql="select count(sku) from products where ended =
> 0"][/query]


> Still have not discovered why query tag will not work, by its self in my
> original
> Post. If any one has ideas there I would really appreciate it.
> It would allow me to understand how understand interchange runs different
> queries.

Assuming the query is valid (which I can't verify), the use of [query]
is sending the results off into oblivion.

I am guessing from the context that you would expect the interpolation
to be replaced with the number showing count(sku). To do that, you need
(a) the list parameter true, and (b) the body to include the proper
PREFIX-* tags to show what you want:

> [query
> 	list=1
> 	sql="
> FROM products
> WHERE ended = 0
> "][sql-code][/query]


Mark Johnson
End Point Corporation

More information about the interchange-users mailing list