Datetime - find records that are created in a date/time range

  • Does the table in question have a column in it that holds the creation date?

    Have you tried to write a query for this? If so, what problem are you running into with it?

    Honestly, this sounds like a test/homework/interview question. If it is, you should either already know the answer, or be doing the research to figure out the answer, or simply admit that you don't know. If this is actually work-related (and it doesn't look like it, but it could be), and you haven't the time/know-how to do it, maybe you should consider hiring a contractor to do this kind of thing for you.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks for your reply, first of all.

    Yes, it does have the creation date field.

    If I could write the query already, then I wouldn't be posting here asking for help- don't you think?

    No it's not a homework -

    Thanks.

  • You seem to have deleted the original question and all its specifications.

    If it has a createddate field in the table, it should be a matter of using something like this:

    select *

    from dbo.MyTable

    where createddate >= @StartDate

    and createddate < @EndDate;

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (3/12/2009)


    You seem to have deleted the original question and all its specifications.

    Very poor forum etiquette -don't you think newB?

    -- You can't be late until you show up.

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

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