Kueri Anda disederhanakan hampir menjadi omong kosong, tetapi sesuatu seperti ini akan berhasil.
SELECT ...
FROM ....
INNER JOIN (SELECT '2017-12-01' AS beginDate, '2017-12-30' AS endDate) AS dr
ON (ship.dateShipped BETWEEN dr.beginDate AND dr.endDate)
OR (fulfill.datefulfilled BETWEEN dr.beginDate AND dr.endDate)
...
Itu benar-benar tidak akan membiarkan Anda menggunakan @ variabel?