Re: How to sum the table records?



Alex Murphy wrote:
Hi all,

I using the "list" function to extract the sales text delimited file
and insert into the table. How to find out the best sales item and
worst sales item?

Summing is easy:

SELECT `item`, SUM(`qty`) AS 'total_sold' FROM table_name GROUP BY `item`

Extracting best and worst in one query in one go is a little bit trickier.
I'm sure it's possible in one query, but I'm not familiar enough with JOINS
or subqueries to figure that one out.

That's more of a database question, which database are you using?

Grtz,
--
Rik Wasmus


.



Relevant Pages

  • Re: Query Records since last run
    ... Store the value in a table, text file, registry setting, or global variable. ... and retrieve it before or during the query. ... > Customer Sales Date Sales Value ... I only want to extract records added to the sales table SINCE ...
    (microsoft.public.access.queries)
  • Re: How to do an Access Database Query in Excel
    ... This is the Macro I've recorded to do exactly what I manually do to extract ... Before it exports to Excel I wish it to SUM by Location ... each Item sales, so not sure where I would put that in the code below. ...
    (microsoft.public.excel.programming)
  • If Function - Date Problem
    ... particular customer's sales but as individual lines, ... Ultimately I need to extract this info monthly to perform some ... original sales sheet. ... I've looked at pivot tables but they just seem to provide totals. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Extracting Latest Date
    ... >I have a db which stores all my sales transactions. ... >The task is to extract the buy pricefor each itemwhere the ...
    (microsoft.public.sqlserver.mseq)
  • Query Records since last run
    ... I run the same query, I want to extract only records since the last ... Customer Sales Date Sales Value ... I only want to extract records added to the sales table SINCE ...
    (microsoft.public.access.queries)