I have a subselect that should be working but doesn't. Been at it too long today. Can anyone guide me?DECLARE @Calendar1 AS DateTimeSET @Calendar1 = '{{{ Please choose a start date. }}}'SELECT('0' + CONVERT (varchar (10), W.WorkerID)) AS VendorID, (W.FirstName + ' ' + W.LastName) AS VendorName, (W.FirstName + ' ' + W.LastName) AS Contact, W.WorkerID AS AccountNumber, W.Address, W.Address2, W.City, W.State, (W.Zip) AS ZipCode, "ExpenseAccount" =CASE WHEN D.FleetID = 1 THEN '51001' WHEN D.FleetID = 4 THEN '51004' WHEN D.FleetID = 6 THEN '51006' WHEN D.FleetID = 7 THEN '51007' WHEN D.FleetID = 8 THEN '51008' ELSE '51001'ENDFROM tblWorker AS W INNER JOIN tblDrivers AS D ON D.DriverID = W.WorkerID WHERE W.Status <> 2 AND W.WorkerID > 100 AND @Calendar1 >= (SELECT SH.BeginDate FROM tblSettlementHistory AS SH)ORDER BY W.WorkerID
Where did I go wrong?