Resources » Code Snippets » ASP.NET WebForms

Select max and Min DateTime of a column in DataTable


Posted Date: 15-Jan-2009  Last Updated:   Category: ASP.NET WebForms    
Author: Member Level: Gold    Points: 2



To Select the Max and Min you can use this code.

DateTime StartTime = Convert.ToDateTime((dt.Compute("min(StartDate)", string.Empty)));

DateTime EndTime = Convert.ToDateTime((dt.Compute("max(EndDate)", string.Empty)));

Happy Coding


Did you like this resource? Share it with your friends and show your love!

Responses to "Select max and Min DateTime of a column in DataTable"
Author: nRk    17 Sep 2009Member Level: Silver   Points : 0
thanks...


Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Tara Prasad
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India