1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] How can I truncate a datetime in SQL Server?

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    What's the best way to truncate a datetime value (as to remove hours minutes and seconds) in SQL Server?

    For example:

    declare @SomeDate datetime = '2009-05-28 16:30:22'
    select trunc_date(@SomeDate)

    -----------------------
    2009-05-28 00:00:00.000

    Continue reading...

Compartilhe esta Página