Date Question

  • I've a Table with several fields, one of which is a datetime field in whech is stored the date an entry was made to that table, my question is, how can I do a select all where the date is 4 weeks or less ago?

  • You could do something like

    SELECT *

    FROM Table

    where datetime >= DATEADD(week, -4, GETDATE())

    Obviously the use of getdate() may not be appropriate for you but hopefully you get the idea

    hth

     

    David

  • that's brilliant, thanks

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

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