Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 03-09-2012
Avatar de martini002
martini002 martini002 is offline
Miembro
 
Registrado: may 2012
Ubicación: Puerto Ordaz - Venezuela
Posts: 175
Poder: 15
martini002 Va por buen camino
Hola Ecfisa,

Bueno no creo que sea muy conveniente usar el Reformat Date Strings.

Cita:
Ideally the dates in the column would have two digits for the month, two for the day and 4 digits for the year, in which case it would be a simple matter of using the SUBSTR function to extract the elements and rearrange them as shown below.
Código SQL [-]
SUBSTR(date_field,7,4)||'-'||SUBSTR(date_field,1,2)||'-'||SUBSTR(date_field ,4,2)

Cita:
Unfortunately in the example above, some of the values in the date column have only one digit for the month and or day. Using SELECT CASE and the CAST(substring AS INTEGER) function makes it possible to extract the value of the month and the day.
Código SQL [-]
(SELECT SUBSTR(date_field,-4,4)) ||'-'||(SELECT CASE WHEN CAST(SUBSTR(date_field,1,2) AS INTEGER)>=10 THEN SUBSTR(date_field,1,2) ELSE '0'|| CAST(SUBSTR (date_field,1,2) AS INTEGER) END ) ||'-'|| (SELECT CASE WHEN CAST(SUBSTR(date_field,-7,3) AS INTEGER)>=10 THEN SUBSTR(date_field,-7,2) ELSE '0'|| CAST(SUBSTR(date_field,-6,2) AS INTEGER) END) AS 'date_field'

Código SQL [-]
 UPDATE table_name SET date_field = (select substr(date_field,-4,4)) ||'-'|| (SELECT CASE WHEN CAST(SUBSTR(date_field,1,2) AS INTEGER) >= 10 THEN SUBSTR(date_field,1,2) ELSE '0'|| CAST(SUBSTR (date_field,1,2) AS INTEGER) END ) ||'-'|| (SELECT CASE WHEN CAST(SUBSTR(date_field,-7,3) AS INTEGER)>=10 THEN SUBSTR(date_field,-7,2) ELSE '0'|| CAST(SUBSTR(date_field,-6,2) AS INTEGER) END);

Cita:
NOTE: When doing a mass update in a table it is often a good idea to make a back up of the table before doing your changes.
Con respecto a lo otro voy a revisar sobre como colocar el formato a esto:
Cita:
INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.
creo que podria ser lo mas adecuado sino se logra cambiar el formato de la fecha,
Saludos,
Gracias.
__________________
El Conocimiento se puede compartir, pero la Experiencia es totalmente Intransferible.
Responder Con Cita
  #2  
Antiguo 03-09-2012
Avatar de martini002
martini002 martini002 is offline
Miembro
 
Registrado: may 2012
Ubicación: Puerto Ordaz - Venezuela
Posts: 175
Poder: 15
martini002 Va por buen camino
No he podido dar con un buen resultado aun,
si alguien mas tiene alguna idea para resolver esta incompatibilidad
entre el Picker y la BD le agradeceria muchisimo

Gracia
__________________
El Conocimiento se puede compartir, pero la Experiencia es totalmente Intransferible.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Fechas por rangos con 2 DateTimePicker Darkseratul Conexión con bases de datos 2 23-02-2011 11:12:16
Fechas y Datetimepicker en delphi5 zcatzz Varios 16 15-05-2007 23:16:50
Formato de fechas y DateTimePicker. aoiTo C++ Builder 9 08-12-2006 01:13:39
Between DateTimePicker com fechas iguais le4br SQL 3 23-02-2005 05:18:56
Ver Hora en DateTimePicker en formato de 24Hrs franciscobucio Varios 5 18-10-2004 20:09:36


La franja horaria es GMT +2. Ahora son las 12:21:15.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi