P
perplexed
I have a query that combines two table. The Schedule Table and the Daily
Journal Table. The relationship join is set to "Only Include Rows where the
join fields from both tables are equal. " Yet I am getting a duplicate record
of each (i.e. I have two records with mirror data of ID 2262; I assume one
for the schedule table and one for the daily journal table). I have my
properties set for Unique Records: YES. My SQL Code looks like this: SELECT
DISTINCTROW [Table: Schedule].ID, [Table: Schedule].[Appt Date], [Table:
Schedule].[Appt Time], [Table: Schedule].Customer, [Table: Schedule].[PO #],
DAILY_JOURNAL.[PO #], [Table: Schedule].[Trucking Co], DAILY_JOURNAL.[Actual
Ship Date], DAILY_JOURNAL.[Appt Time], DAILY_JOURNAL.Customer,
DAILY_JOURNAL.[LOL Order Number], DAILY_JOURNAL.[Trucking Co],
DAILY_JOURNAL.[Orig Ship Date], DAILY_JOURNAL.[Checked - IN],
DAILY_JOURNAL.[Checked Out], DAILY_JOURNAL.Comments, DAILY_JOURNAL.[Order
Shipped On Time], DAILY_JOURNAL.[NFDM Incoming], DAILY_JOURNAL.[Freight
Incoming], DAILY_JOURNAL.[Pallets Incoming], DAILY_JOURNAL.[Pkg Incoming],
DAILY_JOURNAL.[Salt Incoming], DAILY_JOURNAL.[Trays Incoming],
DAILY_JOURNAL.[Rescheduled by Denmark], DAILY_JOURNAL.[Rescheduled by
Customer], DAILY_JOURNAL.[No Show], DAILY_JOURNAL.[Show/No Appt],
DAILY_JOURNAL.[Carrier Issue], DAILY_JOURNAL.[DELETE RECORD & APPT]
FROM [Table: Schedule] INNER JOIN DAILY_JOURNAL ON ([Table: Schedule].[PO #]
= DAILY_JOURNAL.[PO #]) AND ([Table: Schedule].[Appt Time] =
DAILY_JOURNAL.[Appt Time]) AND ([Table: Schedule].Customer =
DAILY_JOURNAL.Customer) AND ([Table: Schedule].[Appt Date] =
DAILY_JOURNAL.[Actual Ship Date])
GROUP BY [Table: Schedule].ID, [Table: Schedule].[Appt Date], [Table:
Schedule].[Appt Time], [Table: Schedule].Customer, [Table: Schedule].[PO #],
DAILY_JOURNAL.[PO #], [Table: Schedule].[Trucking Co], DAILY_JOURNAL.[Actual
Ship Date], DAILY_JOURNAL.[Appt Time], DAILY_JOURNAL.Customer,
DAILY_JOURNAL.[LOL Order Number], DAILY_JOURNAL.[Trucking Co],
DAILY_JOURNAL.[Orig Ship Date], DAILY_JOURNAL.[Checked - IN],
DAILY_JOURNAL.[Checked Out], DAILY_JOURNAL.Comments, DAILY_JOURNAL.[Order
Shipped On Time], DAILY_JOURNAL.[NFDM Incoming], DAILY_JOURNAL.[Freight
Incoming], DAILY_JOURNAL.[Pallets Incoming], DAILY_JOURNAL.[Pkg Incoming],
DAILY_JOURNAL.[Salt Incoming], DAILY_JOURNAL.[Trays Incoming],
DAILY_JOURNAL.[Rescheduled by Denmark], DAILY_JOURNAL.[Rescheduled by
Customer], DAILY_JOURNAL.[No Show], DAILY_JOURNAL.[Show/No Appt],
DAILY_JOURNAL.[Carrier Issue], DAILY_JOURNAL.[DELETE RECORD & APPT]
HAVING ((([Table: Schedule].Customer) Is Not Null))
ORDER BY [Table: Schedule].[Appt Date], [Table: Schedule].[Appt Time];
Any clues how I can fix this?
Journal Table. The relationship join is set to "Only Include Rows where the
join fields from both tables are equal. " Yet I am getting a duplicate record
of each (i.e. I have two records with mirror data of ID 2262; I assume one
for the schedule table and one for the daily journal table). I have my
properties set for Unique Records: YES. My SQL Code looks like this: SELECT
DISTINCTROW [Table: Schedule].ID, [Table: Schedule].[Appt Date], [Table:
Schedule].[Appt Time], [Table: Schedule].Customer, [Table: Schedule].[PO #],
DAILY_JOURNAL.[PO #], [Table: Schedule].[Trucking Co], DAILY_JOURNAL.[Actual
Ship Date], DAILY_JOURNAL.[Appt Time], DAILY_JOURNAL.Customer,
DAILY_JOURNAL.[LOL Order Number], DAILY_JOURNAL.[Trucking Co],
DAILY_JOURNAL.[Orig Ship Date], DAILY_JOURNAL.[Checked - IN],
DAILY_JOURNAL.[Checked Out], DAILY_JOURNAL.Comments, DAILY_JOURNAL.[Order
Shipped On Time], DAILY_JOURNAL.[NFDM Incoming], DAILY_JOURNAL.[Freight
Incoming], DAILY_JOURNAL.[Pallets Incoming], DAILY_JOURNAL.[Pkg Incoming],
DAILY_JOURNAL.[Salt Incoming], DAILY_JOURNAL.[Trays Incoming],
DAILY_JOURNAL.[Rescheduled by Denmark], DAILY_JOURNAL.[Rescheduled by
Customer], DAILY_JOURNAL.[No Show], DAILY_JOURNAL.[Show/No Appt],
DAILY_JOURNAL.[Carrier Issue], DAILY_JOURNAL.[DELETE RECORD & APPT]
FROM [Table: Schedule] INNER JOIN DAILY_JOURNAL ON ([Table: Schedule].[PO #]
= DAILY_JOURNAL.[PO #]) AND ([Table: Schedule].[Appt Time] =
DAILY_JOURNAL.[Appt Time]) AND ([Table: Schedule].Customer =
DAILY_JOURNAL.Customer) AND ([Table: Schedule].[Appt Date] =
DAILY_JOURNAL.[Actual Ship Date])
GROUP BY [Table: Schedule].ID, [Table: Schedule].[Appt Date], [Table:
Schedule].[Appt Time], [Table: Schedule].Customer, [Table: Schedule].[PO #],
DAILY_JOURNAL.[PO #], [Table: Schedule].[Trucking Co], DAILY_JOURNAL.[Actual
Ship Date], DAILY_JOURNAL.[Appt Time], DAILY_JOURNAL.Customer,
DAILY_JOURNAL.[LOL Order Number], DAILY_JOURNAL.[Trucking Co],
DAILY_JOURNAL.[Orig Ship Date], DAILY_JOURNAL.[Checked - IN],
DAILY_JOURNAL.[Checked Out], DAILY_JOURNAL.Comments, DAILY_JOURNAL.[Order
Shipped On Time], DAILY_JOURNAL.[NFDM Incoming], DAILY_JOURNAL.[Freight
Incoming], DAILY_JOURNAL.[Pallets Incoming], DAILY_JOURNAL.[Pkg Incoming],
DAILY_JOURNAL.[Salt Incoming], DAILY_JOURNAL.[Trays Incoming],
DAILY_JOURNAL.[Rescheduled by Denmark], DAILY_JOURNAL.[Rescheduled by
Customer], DAILY_JOURNAL.[No Show], DAILY_JOURNAL.[Show/No Appt],
DAILY_JOURNAL.[Carrier Issue], DAILY_JOURNAL.[DELETE RECORD & APPT]
HAVING ((([Table: Schedule].Customer) Is Not Null))
ORDER BY [Table: Schedule].[Appt Date], [Table: Schedule].[Appt Time];
Any clues how I can fix this?