Too Complex For Me...Maybe You?

  • This is beyond me....

    Look at the photo of my view please...

    https://www.readysecure2.com/users/polajenkocom/images/combine.jpg

    I want to get all records with a CreatedDate that is within the past 7 days. Can anyone help me do this?

    Thanks

    Alex Polajenko


    Alex Polajenko

  • 
    
    SELECT
    'Announcement'
    , ItemID
    , ModuleID
    , CreatedByUser
    , CreatedByDate
    FROM Announcements
    WHERE
    DATEADD(d, 0, DATEDIFF(d, 0, CreateDate)) >= DATEADD(d, -7, DATEDIFF(d, 0, GETDATE())
    UNION
    SELECT
    'Document'
    , ItemID
    , ModuleID
    , CreatedByUser
    , CreatedByDate
    FROM Documents
    WHERE
    DATEADD(d, 0, DATEDIFF(d, 0, CreateDate)) >= DATEADD(d, -7, DATEDIFF(d, 0, GETDATE())
  • Thank you very much sir..That did it.

    Alex Polajenko


    Alex Polajenko

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

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