Home Forums SQL Server 2008 T-SQL (SS2K8) wish to add rows having NULL values as placeholders for "missing" dates RE: wish to add rows having NULL values as placeholders for "missing" dates

  • Try this

    select * from _dates d

    left outer join cannedbackupjobs dbj on d.d = CONVERT(VARCHAR(10), dbj.starttime, 120)

    where d.d between (select min(starttime) from cannedbackupjobs) and (select max(starttime) from cannedbackupjobs);

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537