Date - compare 2 columns - one is string other is seconds

  • need to look through hundreds of rows and compare two columns, and pull out rows where the date difference is 7 days

    problem is one column stores the date as a string and values in that column look like this:

    01/12/2007 10:15 pm

    or

    01/12/2007

    the other column stores the date as seconds since 1/1/1970, which is good and easy to work with..

    how do I write the select?

    any ideas

    thnx

    tony

  • SELECT *

    FROM Table1

    WHERE DATEDIFF(SECOND, '19700101', Col1) - Col2 BETWEEN -604800 AND 604800

     


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply