Good morning Team,
I am using a Cognex camera to 'count' cases coming from our production floor. The production floor receives items from 5 different packing locations.
I have been asked to segregate the SKUs by pack station.
Since the data is coming from a scanner, I am unsure how to solve this.
I thought perhaps mapping, but that will not work.
SKU Counts Pack Station
1376 177 1
1952 162 2
1378 152 2
One other note. The cognex camera is only capturing the SKU and counts incrementally.
My appologies. This is an excel export of the data that is captured. I would like to have a 3rd column, Pack Station, that identifieds the pack station from which the SKU comes from.
SELECT ProductCode AS SKU, count (ProductCode) AS Counts
FROM Cut_ProductCountScanner
WHERE t_stamp >= :StartDate
and t_stamp <= :EndDate
and ShiftProduced = 1
GROUP BY ProductCode
ORDER BY count (ProductCode) desc
SKU Counts Pack Station
1952 233 2
1376 227 1
1955 196 1
1715 195 2
1926 159 3
SELECT
ProductCode AS SKU,
COUNT(ProductCode) AS Counts,
Station
FROM Cut_ProductCountScanner
WHERE t_stamp >= :StartDate
AND t_stamp <= :EndDate
AND ShiftProduced = 1
GROUP BY ProductCode
ORDER BY
Station,
COUNT(ProductCode) DESC
Watch your ≥ and ≤ in the WHERE clause. Usually you want ≥ and < so that you don't show the start of the next shift on today's report and tomorrow's as well (if you happened to get a reading right on the shift-change).
My issue is that the data is coming from a camera that provides the SKU and count.
There is no pack station associated to the data source.
Show how you are capturing the data from the cameras and inserting it into the Cut_ProductCountScanner table.
I am not sure if this is what you need.
The camera captures just the SKU number. We capture the data in our db.
SELECT TOP (1000) [ID]
,[ProductCode]
,[ScannerCount]
,[ShiftProduced]
,[t_stamp]
FROM [Ignitioncw].[dbo].[Cut_ProductCountScanner]
You're showing how you're getting data out of the database. We need to see how you're putting it into the database.
You are going to need to add a column for Station but we need the other information first.
Ok, that helps. I will get that information and come back.
Thanks!!