How can i find trim date in a DateTime field?

  • I'm looking for method to find only date in a DateTime field. For example, i have this field with this value <'09/09/2004 10:30:25.525'>. I only want to find the date that the field has <'09/09/2004'>. How can i do it?


    Kindest Regards,

    Jairo Eligio Peñaló Sánchez

  • CONVERT( varchar, MyDateColumn, 101 )

    If you want it in a datetime field just convert back again. This results in a zero time which is midnight.

    CONVERT( datetime, CONVERT( varchar, MyDateColumn, 101 ) )

     

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

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