0

While browsing this thread I noticed that the code was unformatted. Mr. Waddell is well aware of how to format code so I was surprised. When I went to edit the code, however, I saw that it was formatted correctly. Here is a section of the code as originally entered

Wow! Thats a lot of Code to go through!

So I'll just go back to your question... You have a list of items and for each item you want to give total in stock and cash value.

OK there are two ways to do this:

  1. Through a SQL query using SUM on the quantity and on the total and grouping by the other item fields : SELECT itemno, name, SUM(qty) As qty, price, SUM(Total) as Total FROM tblInventory GROUP BY itemno, name, price

  2. Or as you said by looping through the records:

    dim itemNo, CurrentItem as integer
    dim ItemName as string
    dim UnitPrice as decimal

I had to reformat it as follows to get the code block to display properly

1.Through a SQL query using SUM on the quantity and on the total and grouping by the other item fields : SELECT itemno, name, SUM(qty) As qty, price, SUM(Total) as Total FROM tblInventory GROUP BY itemno, name, price
2. Or as you said by looping through the records:

dim itemNo, CurrentItem as integer
dim ItemName as string
dim UnitPrice as decimal

Edited by Reverend Jim

3
Contributors
4
Replies
20
Views
3 Years
Discussion Span
Last Post by Reverend Jim
0

I did manage to get the code to format properly but I don't understand why it did not format properly as originally entered. here was a space between list item 2 and the code so it should have been recognized as code because it was properly indented.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.