Create the following columns in the query grid.
NOTE: In the following query, an underscore (_) at the end of a line is
used as a line-continuation character. Remove the underscore from the
end of the line when re-creating this query.
NOTE: In Microsoft Access 2.0, replace all instances of [CustomerID],
[OrderID] and [OrderDate] in the following example with [Customer ID],
[Order ID] and [Order Date] respectively.
Query: Compare Orders Query
---------------------------
Type: Select Query
Join: Orders.[CustomerID]<->Orders_1.[CustomerID]
Field: CustomerID
Table: Orders
Sort: Ascending
Field: OrderDate
Table: Orders
Sort: Ascending
Field: DaysBetweenOrders: DateDiff("d",[Orders].[OrderDate],_
[Orders_1].[OrderDate])
Criteria: Between 1 And 60
Field: OrderID
Table: Orders
Field: NextOrderDate: [OrderDate]
Table: Orders_1
|