![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#4
|
||||
|
||||
|
En efecto el CAST es la menos recomendable de todas, y la función CONVERT está limitada a la lista predeterminada.
Para convertir algo como TO_DATE('HORA:12 MINUTOS:03 SEGUNDOS:33', '"HORA:"HH" MINUTOS:"MI" SEGUNDOS:"SS'), en SQL Server tendrias que jugar con el SUBSTRING para sacar las partes de la hora, y construir una de las cadenas que si puede convertir. SET @Variable = 'HORA:12 MINUTOS:03 SEGUNDOS:33' select CAST(SUBSTRING(@Variable, 6, 2) + ':' + SUBSTRING(@Variable, 18, 2) + ':' SUBSTRING(@Variable, 30, 2) as DATETIME) Sin duda es mucho más incomodo. Saludos.
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no). |
|
|
|