locked
Pull latest data from database RRS feed

  • Question

  • User-322746205 posted

    Hi,

    I want to pull the latest data from database by checking the latest start_time in my table Exam.

    How to code it?

    Thanks.

    Wednesday, May 9, 2012 11:07 PM

Answers

  • User-1316079624 posted

    Hi,

    Try something like this:

    select MAX(start_time) as LatestDate from Exam
    


    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 9, 2012 11:14 PM

All replies

  • User-1316079624 posted

    Hi,

    Try something like this:

    select MAX(start_time) as LatestDate from Exam
    


    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 9, 2012 11:14 PM
  • User-451195045 posted
    hi you can try
    
    select top(1) * from mytable order by start_time desc
    
    
    
    hope will help you



    Wednesday, May 9, 2012 11:15 PM
  • User-322746205 posted

    Thanks.. Its work!! Smile

    Wednesday, May 9, 2012 11:25 PM