none
To Extract Date from DateTime RRS feed

Answers

  • Hi!

     

    Please try this.

    SELECT CAST(GETDATE() AS DATE)
    


    GETDATE() Function return a datetime, if you have Column say JoinDate you can use it as

    SELECT CAST(JoinDate AS DATE) AS JoinDate
    


    I hope this is helpful

     

    Elmozamil Elamir

     

    MyBlog


    Elmozamil Elamir Hamid http://elmozamil.blogspot.com
    • Marked as answer by Kiran_msk Wednesday, December 28, 2011 8:45 AM
    Wednesday, December 28, 2011 7:11 AM

All replies

  • Hi,

    Welcome to MSDN Forums..!

    You can get that done using the CONVERT function.And a sample would look like this

    select convert(char(10),getdate(),101)

    -+-+-+-+-+-+-+-+-+-+-+-+

    Learn, Earn, Enjoy.!


    Thanks, Satish Bommideni
    Wednesday, December 28, 2011 6:56 AM
  • Hi!

     

    Please try this.

    SELECT CAST(GETDATE() AS DATE)
    


    GETDATE() Function return a datetime, if you have Column say JoinDate you can use it as

    SELECT CAST(JoinDate AS DATE) AS JoinDate
    


    I hope this is helpful

     

    Elmozamil Elamir

     

    MyBlog


    Elmozamil Elamir Hamid http://elmozamil.blogspot.com
    • Marked as answer by Kiran_msk Wednesday, December 28, 2011 8:45 AM
    Wednesday, December 28, 2011 7:11 AM
  • Thanq..
    Wednesday, December 28, 2011 8:45 AM
  • You are Welcome.


    Elmozamil Elamir Hamid http://elmozamil.blogspot.com
    Wednesday, December 28, 2011 9:05 AM