does getdate() produce only the MOST recent datetime?

  • lets say i have a column which is simply: datetime, and i want to

    run getdate()

    would the getdate() return ONLY the most recent value? like in the

    following records.

    this being most recent: (2007-01-23 13:22:03.350) ??

    2007-01-23 13:22:03.350

    2007-01-23 10:17:34.723

    2007-01-23 09:50:29.673

    2007-01-23 09:49:14.613

    2007-01-23 09:18:40.043

    2007-01-23 04:01:13.353

    just need to be absolutely sure here, and figure i

    would as some others in the sql community.

    i can run test after test, but how do i know it

    will be consistent 100% of the time? doesn't hurt

    to ask.

    thanks in advance.

    _________________________

  • getdate() returns current date and time like the clock.

    Regards,Yelena Varsha

  • GETDATE() is a system function for returning the system's current date/time. If you want to get the most recent date from a column use MAX()... example:

    SELECT Max(MyDateTimeColumn) FROM MyTable

    SELECT GETDATE() will always return the current date/time.

  • wow... many thanks!

    thats just the information i needed!

    you guys rock!

    _________________________

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

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