I have a query as follows
SELECT ajd.Make, ajd.Model, ajd.Filter, ajd.Notes, ajd.CatamacPartNumber, ajd.FromDate, ajd.ToDate
FROM ApplicationJapData ajd
WHERE ajd.Model LIKE '%FVR34%'
AND FromDate <= '20140701' AND ToDate >= '20140701'
What this query does is select rows based on
containing certain search string, and where supplied date is between columns
The problem is that sometimes ToDate is
, because it is up to current date (For instance,
because it is
So if I supply a value of 12-12-2015, I would still like to return rows if it meets the
However, I can't use
FromDate <= '20140701' OR ToDate >= '20140701'
because there might be
, in which case it would be incorrect with supplied date of
Any help is much appreciated, and please ask if anything is unclear or needs clarifying!