Issue with Joining on datetime field

Last Post 04 Sep 2009 08:54 AM by Balance. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Balance
New Member
New Member

--
04 Sep 2009 08:54 AM
I need to get all jobs who have been updated since the last time they were pulled. But for some reason the query below doesn't work. Keep in mind, that updateDt could have NULL values, which means the job hasn't been updated. I've tried SET ANSI_NULLS OFF/ON without avail. Can someone please shed some light?

SET ANSI_NULLS OFF
select jas.jobID from JobAlertSends jas INNER JOIN jobs ON jas.jobUpdateDt = jobs.updateDt

jobID
-----------

(0 row(s) affected)


SELECT TOP 5 jobUpdateDt FROM JobAlertSends ORDER BY jobUpdateDt

jobUpdateDt
------------------------------------------------------
NULL
NULL
NULL
NULL
NULL

(5 row(s) affected)


SELECT TOP 5 updateDt FROM jobs ORDER BY updateDt

updateDt
------------------------------------------------------
NULL
NULL
NULL
NULL
NULL

(5 row(s) affected)


Why is it that joining results in 0 rows?

TIA
You are not authorized to post a reply.

Acceptable Use Policy