• Portada
    • Recent
    • Users
    • Register
    • Login

    Problema al sacar una fecha de una bdd SQL

    Scheduled Pinned Locked Moved Software
    4 Posts 3 Posters 1.7k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • packosoftP Offline
      packosoft Admin honoris causa
      last edited by

      Estoy intentando sacar una fecha de un campo datetime desde SQL, pero me la devuelve con el formato

      Dec 21 2005  5:01PM             ```y necesitaria algo del estilo 

      MM-DD-AAAA

      MM DD AAAA o MMDDAAAA

      El no usar ni la / ni los : es porque necesito que el resultado vaya en el nombre de un fichero. Como handicap adicional, decir que es una BDD Sybase SQL Server 11.9.2 del año de maricastaña.  Alguna idea?
      1 Reply Last reply Reply Quote 0
      • _ruso_ Offline
        _ruso
        last edited by

        SQL Server Helper - Tips and Tricks - Date Formats

        packosoftP 1 Reply Last reply Reply Quote 0
        • packosoftP Offline
          packosoft Admin honoris causa @_ruso
          last edited by

          muchas gracias ruso, por fin lo he conseguido con

          CONVERT(VARCHAR(10), titles.last_modif_time, 110)  
          SATANS 1 Reply Last reply Reply Quote 0
          • SATANS Offline
            SATAN @packosoft
            last edited by

            Bueno llego tarde pero si quieres tambien puede hacerlo con la funcion to_char

            TO_CHAR(fecha, 'MM-DD-YYYY')

            Saludos.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Foreros conectados [Conectados hoy]

            0 usuarios activos (0 miembros y 0 invitados).
            febesin, pAtO, smith, pos_yo

            Estadísticas de Hardlimit

            Los hardlimitianos han creado un total de 543.8k posts en 62.9k hilos.
            Somos un total de 37.5k miembros registrados.
            soniahutchinso ha sido nuestro último fichaje.
            El récord de usuarios en linea fue de 222 y se produjo el Mon Jul 27 2026.