• Its another team that are in-charge of the source db so Im not sure why these datatypes have been selected, I know c# guids are used all over the place for ids (UserID & StockTransactionType) but they never exceed 36 nvarchar. bearing in mind im pulling this data over into my reporting db which im just building the only query that is running against it just now is

    SELECT

    DATENAME(MONTH, pish.[InductedDate]) + ' ' + CAST(YEAR(pish.[InductedDate]) AS CHAR(4)) [InductedMonth],

    CAST(pish.[InductedDate] AS DATE) [InductedDate],

    DATEPART(hh,pish.[InductedDate]) [InductedHour],

    pish.[Barcode] [InductBarcode],

    pish.[ItemType] [InductItemType],

    pish.[ItemDefinition] [InductItemDefinition],

    pish.[SKU],

    pish.[SizeCode],

    pish.[MovingTo]

    FROM

    [Picking].[InductScanHistory] pish

    WHERE

    DATEPART(isowk, pish.[InductedDate]) >= DATEPART(isowk, GETDATE())-1 AND pish.[InductedDate] <= DATEADD(ms, -3, DATEADD(dd, DATEDIFF(dd, 0, GetDate()), 0))

    ORDER BY

    pish.[InductedDate]

    but anything other will most probably be filtered by the InductedDate and grouped Barcode,ItemType,SizeCode.