D
Dan
Hello -
I have the following query which I am wanting to show only unique
records in the UPC column. I've tried using the Totals, Group By and
First with no results.
SELECT [dbo_Item - MT].UPC_11,
Trim([Dept_Num]) AS [HOST POS],
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "211",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 211,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "212",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 212,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "214",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 214,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "215",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 215,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "216",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 216,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "217",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 217
FROM [dbo_BRD_STOREBATCH - MT] INNER JOIN [dbo_Item - MT] ON
[dbo_BRD_STOREBATCH - MT].UPC = [dbo_Item - MT].UPC_14
WHERE ((([dbo_Item - MT].UPC_11) Not Like "000000*") AND
((Trim([Dept_Num]))<>[dbo_BRD_STOREBATCH - MT]![DEPT]))
ORDER BY [dbo_Item - MT].UPC_11;
Results:
UPC_11 HOST POS 211 212 214 215 216 217
00005645388 52 14
00005645389 52 13
00005645400 52 88
00005645400 52 14
00005645410 14 52
00005645425 52 14
00005645425 52 14
00005645425 52 14
I would like the UPC_11 unique:
UPC_11 HOST POS 211 212 214 215 216 217
00005645388 52 14
00005645389 52 13
00005645400 52 88 14
00005645410 14 52
00005645425 52 14 14 14
Thanks for any assistance!
Dan
I have the following query which I am wanting to show only unique
records in the UPC column. I've tried using the Totals, Group By and
First with no results.
SELECT [dbo_Item - MT].UPC_11,
Trim([Dept_Num]) AS [HOST POS],
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "211",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 211,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "212",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 212,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "214",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 214,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "215",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 215,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "216",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 216,
IIf([dbo_BRD_STOREBATCH - MT].zone1 Like "217",[dbo_BRD_STOREBATCH -
MT].dept,"") AS 217
FROM [dbo_BRD_STOREBATCH - MT] INNER JOIN [dbo_Item - MT] ON
[dbo_BRD_STOREBATCH - MT].UPC = [dbo_Item - MT].UPC_14
WHERE ((([dbo_Item - MT].UPC_11) Not Like "000000*") AND
((Trim([Dept_Num]))<>[dbo_BRD_STOREBATCH - MT]![DEPT]))
ORDER BY [dbo_Item - MT].UPC_11;
Results:
UPC_11 HOST POS 211 212 214 215 216 217
00005645388 52 14
00005645389 52 13
00005645400 52 88
00005645400 52 14
00005645410 14 52
00005645425 52 14
00005645425 52 14
00005645425 52 14
I would like the UPC_11 unique:
UPC_11 HOST POS 211 212 214 215 216 217
00005645388 52 14
00005645389 52 13
00005645400 52 88 14
00005645410 14 52
00005645425 52 14 14 14
Thanks for any assistance!
Dan