Good morning,
Still a newbie here… I’ve come a long way with my applications, but now I’ve come to a road block. Simplified, my current application is like this:
Table1
- Account number
- SubGroup number
Table2
- SubGroup number
- Widget sales
Table 2 holds literally thousands of Widget Sales, and my grids work great by pulling, for example, the widget sales related to Account number 1 (WHERE SubGroup = SubGroup)…very simple.
But now if the Account Number has several SubGroups of its own, how can I pull the total Widget Sales into a Grid for a single Account number? Again, my current example is looking up Account number 1, then pulling the Widget sales for the one SubGroup number associated with Account number 1. But now I need to query for the total Widget sales for ALL SubGroups belonging to Account number 1.
I found an example online for a regular MySql script, but can’t grasp how to apply it to Scriptcase. Essentially the example queries for the SubGropus belonging to Account Number 1 and assigns them to an array. But how do I write my SQL code in the grid (SQL section under Grid properties), to instead of looking for [SubGroup], to look for the new array, which I assume I pull in “onApplicatinoInit”?
Thanks very much for any directives or examples.
Mark.