select status, count(*) from table where ts between ts1 and ts2
  group by status order by status

That should do it.

On 1/2/2020 1:20 PM, Art Tostaine, Jr. wrote:
I have a table that has a carton# (GS1#), and a numeric status.

A carton will be written 1 to many times in the table, something like this:

GS1, Status, TimeStamp
15,10
15,20
15,30
11,10
12,10
12,20
12,60
16,20
15,40

I want a report like this. I also need to select a range on the timestamp.

Status, Qty (hopefully I calculated these right lol)
10,3
20,3
40,1
60,1




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.