Comparing strings and Sum vals

Results 1 to 3 of 3

Thread: Comparing strings and Sum vals

  1. #1
    Raleigh Guest

    Default Comparing strings and Sum vals

    In doing a materials sheet my code, which is a result of a user selecting parts, (So its always dynamic) has written to a DB which looks about like this: (sample)<BR><BR>2 Field names are:<BR>Parts (User selected assemblies)& Quantity (Which is amount of parts required to make assembly)<BR><BR>i.e.<BR>A1&#039s being the partnumber and in the next column are the amount required to build that part.<BR><BR>A1______4<BR>A1______3<BR>A1______2<B R>C1______5<BR>D4______1<BR><BR>I want to test the partnumber field to see if I have exact matches and if I do -response.write to an HTML table which shows only one partnumber (Select distinct) and then Sums the amount per each partnumber.<BR><BR>The above example would return to the screen: A1: 9 <BR><BR>Is there a command that would perform this?<BR>Something like: (Statment made up - but you get the idea)<BR>variable = Sum(quantity) where partnumber = A1<BR><BR>Help!!

  2. #2
    Eddie Campbell Guest

    Default RE: Comparing strings and Sum vals

    Not sure if this is quite what you want but...<BR><BR>Select Sum(quantity) As TotalInStock<BR>From MyTable<BR>Where PartNumber=&#039A1&#039<BR><BR>TotalInStock = rs("TotalInStock")

  3. #3
    Raleigh Guest

    Default RE: Comparing strings and Sum vals

    Thats Exactly it!! Thanks! I knew there had to be some way to do it - but wasn&#039t up to speed on the Sum function.<BR><BR>Thanks Eddie!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts