Hi there
I'm working on a dynamic search query. I have a 'Transaction' table, and a TransactionItem table, and one Transaction may have more than one TransactionItem.
My search looks at 'TransactionQuery', which includes all fields of Transaction & TransactionItem and creates 'Dynamic_Query' which contains the results of the search.
I am creating an alias which is a 'sum' of the cost of the 'items' in each transaction. I'm creating an alias, but I'm not sure how to join the tables with the alias. I'm trying one alias at the moment, but will*need three in final query, like:
Sum(TransactionItem.ItemTotal) AS TotalTransactionCost
Currently this just displays the item totals, not the sum of all item totals given a particular ID (all items with TransactionID 7, or whatever)
Here is my current join line, which obviously joins my two tables:
FROM [Transaction] INNER JOIN TransactionItem ON Transaction.TransactionID=TransactionItem.Transact ionID
GROUP BY <all fields other than the aliases>
Could you suggest how I would modify my from/join lineup incorporate these aliases, so I can search the field in my dynamic search code?
Sorry if i haven't been clear enough!
Thanks!
I'm working on a dynamic search query. I have a 'Transaction' table, and a TransactionItem table, and one Transaction may have more than one TransactionItem.
My search looks at 'TransactionQuery', which includes all fields of Transaction & TransactionItem and creates 'Dynamic_Query' which contains the results of the search.
I am creating an alias which is a 'sum' of the cost of the 'items' in each transaction. I'm creating an alias, but I'm not sure how to join the tables with the alias. I'm trying one alias at the moment, but will*need three in final query, like:
Sum(TransactionItem.ItemTotal) AS TotalTransactionCost
Currently this just displays the item totals, not the sum of all item totals given a particular ID (all items with TransactionID 7, or whatever)
Here is my current join line, which obviously joins my two tables:
FROM [Transaction] INNER JOIN TransactionItem ON Transaction.TransactionID=TransactionItem.Transact ionID
GROUP BY <all fields other than the aliases>
Could you suggest how I would modify my from/join lineup incorporate these aliases, so I can search the field in my dynamic search code?
Sorry if i haven't been clear enough!
Thanks!