Postman collection
Orders Read

pixiGetOrdersByDeliveryDate

Returns orders with their shipping address whose delivery date (ShipDate) is a given number of days ahead, equals a given date, or lies in the future.

Selects orders from OrderHeader joined with their shipping address (Addresses via ShipAdrRef) and returns order number, order date, delivery date, shipping vendor and the shipping address fields.

The date filter is a combination of three alternatives joined with OR:

  • DaysToDeliveryDate: orders whose ShipDate lies exactly this many calendar days after today (day boundaries via DATEDIFF(DAY, ...); 0 = today, negative values = past days).
  • DeliveryDate: orders whose ShipDate is exactly equal to the given datetime value.
  • If both DaysToDeliveryDate and DeliveryDate are omitted, all orders whose ShipDate is later than the current date and time are returned.

If both date parameters are passed, orders matching either of them are returned.

Additional filters (combined with AND):

  • ShipVendor: only orders with this ShipVendorCode.
  • ShopID: only orders whose shipping address has this AddrShopID.

No sort order is defined; rows are returned in arbitrary order. There is no paging.

Notes

  • DeliveryDate is compared with ShipDate by exact equality including the time part. If ShipDate contains a time component, pass the exact value or use DaysToDeliveryDate instead.
  • The shop filter uses the shop of the shipping address (AddrShopID), not a shop field of the order header.
  • Orders without a matching shipping address are not returned (inner join).
  • The order status is not filtered, so cancelled or already shipped orders can be included.
  • Without any parameters, all orders with a future delivery date are returned, which can be a large result.
  • The header comment of the procedure ("Template for getting items...") is a leftover and does not describe the procedure.

Tables used

OrderHeader · Read Addresses · Read
SQL object:
dbo.pipiGetOrdersByDeliveryDate
Updated at 2026-10-30