[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Newbie q - help with [query] for multi-table report
I know just enough to get myself into trouble it seems. I need help with
the correct tag syntax to create a report. The code follows, but here's the
scoop in case any of it isn't clear: I need to create a report that lists
each product sku and every purchaser and quantity ordered, etc. Eventually,
I'll create a report page where I can enter the sku, and all the buyers and
quantities ordered will come out in a printable list. For now, I just need
it to work on any level. (but suggestions for the latter are also
appreciated.).
Here's the code I have. Can you tell me where I need to go from here?
[query sql="SELECT orderline.code, orderline.sku, orderline.quantity,
orderline.subtotal, transactions.lname, transactions.fname,
transactions.status, transactions.comments FROM orderline, transactions
WHERE orderline.order_number = transactions.order_number ORDER BY
orderline.sku, transactions.lname"
type=list
more=1
ml=50]
[on_match]Matched<br>[/on_match]
[no_match]Not Found<br>[/no_match]
[list]
[sql-param orderline.code] [sql-param transactions.lname] [whatever
tags are supposed to go here...?]<BR>
[/list]
[more_list]
[more]
[/more_list]
[/query]
I can get it to work if I only look information up from one table. (But
it's also dumb luck with the [sql-tags] in the [list] tag...I'm just copying
from the documentation.) I tried [sql-"some_field_name"], but it doesn't
always work...whereas [sql-param "some_field_name"] seems to. It all falls
apart when I try to add another table.
Thanks so much,
Jordan
PS-I don't need the orderline code field. I was just trying desperately to
get my query to return SOMETHING. I also tried "SELECT *, * from...", but
that didn't seem to help.
Donate to the Troubadour Theater Company - without spending a dime!!
Save money on Long Distance, Internet, or cell phone service. A portion of
the proceeds are donated to Troubadour
http://www.excelir.com/thesavage