DavidT_macktool
Well-known member
In an Inventory dataset I have an integer field "quantity". This field contains positive values when pieces are added and negative values when pieces are used. I am displaying the records in a datagrid and I want the "total pieces on hand" displayed in a label on the form.
How do I total the "Quantity" column of the datagrid and end up with an integer variable I can assign the Label.text to?
I am using an SQLDataset. Should I try to do the summing in the Select statement, HOW?
Should I loop through the rows of the datagrid?
Help on the internet is directed towards displaying totals in the datagrid footer, I dont want that.
I need the total to be updated when a new datagrid record is added.
Any help would be appriciated.
Thanks for looking.
How do I total the "Quantity" column of the datagrid and end up with an integer variable I can assign the Label.text to?
I am using an SQLDataset. Should I try to do the summing in the Select statement, HOW?
Should I loop through the rows of the datagrid?
Help on the internet is directed towards displaying totals in the datagrid footer, I dont want that.
I need the total to be updated when a new datagrid record is added.
Any help would be appriciated.
Thanks for looking.