Check for duplicates in column and determine which row to keep
As @sabinbio commented, you need to add a ROW_NUMBER:

SELECT *
FROM 
 (
   SELECT
      stamps.stampsnr AS 'stampsnr'
     ,stamps.time AS 'time'
     ,stamps.amount AS 'amount'
     ,products.productnamn AS 'productnamn'
     ,products.Artikelnummer AS 'Artikelnummer'
     ,FContainer.id AS 'FlaggId'
     ,FContainer.FlaggId AS 'Flagga'
     ,Tempo.tempo AS 'nuTempoNr'
     ,Tempo.amounttempo AS 'amountTempon'
     ,ROW_NUMBER()  
      OVER (PARTITION BY FContainer.FlaggId  -- for each FlaggId
            ORDER BY stamps.time DESC) AS rn -- assign #1 to latest time
   FROM stamps
   INNER JOIN Tempo
     ON stamps.temponr = Tempo.temponr 
   INNER JOIN products
     ON Tempo.productnr = products.productnr
   INNER JOIN FContainer
     ON stamps.ID = FContainer.id

   WHERE  (stamps.TIME &gt; '" &amp; dtmYesterday &amp; "' + ' 06:00:00') 
     AND (stamps.TIME &lt; '" &amp; dtmNow &amp; "' + ' 06:00:00') 
     AND fcontainer.flaggid = 5 
 ) AS dt
WHERE rn = 1
ORDER BY time