FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#1
|
||||
|
||||
campo vacio
Saludos
Hice esta pequeña funcion para saber si un campo de una tabla esta vacio Function campovacio(campo: variant): boolean; Begin Result:= campo = ''; End; Me funciona en texto pero en campo fecha no He notado q a pesar de que el campo esta vacio tiene el valor de '12:00:00am' y me aparece el siguiente mensaje Could not convert variant of type string into type date Alguien me da una mano? O tiene alguna idea mejor? Gracias
__________________
Dulce Regalo que Satanas manda para mi..... |
#2
|
||||
|
||||
Hola oscarac,
El tipo campo: Variant que has definido, puede tomar cualquier tipo y valor, lo que tienes que hacer es saber de que tipo es el valor que le has pasado a la función.
Un saludo. p.d.: Aquí tienes el resto de tipos. Cita:
__________________
Al hacer una consulta SQL, haz que los demás te entiendan y disfruten de ella, será tú reflejo de tú saber. |
#3
|
||||
|
||||
Hola
Tambien puedes usar las funciones varisempty o varisnull para ver si el campo esta vacio. Si es un campo de un dataset (un TField) está el metodo isnull. Saludos
__________________
Caminante, son tus huellas el camino y nada más; Caminante, no hay camino, se hace camino al andar. Antonio Machado |
#4
|
||||
|
||||
se agradece
funciona
__________________
Dulce Regalo que Satanas manda para mi..... |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Campo vacío en CxGrid | cmfab | Varios | 4 | 02-05-2012 13:25:27 |
Campo Fecha vacio en SQL | oscarac | OOP | 3 | 30-08-2010 17:13:30 |
Reconocer Campo Vacio | lKinGl | Conexión con bases de datos | 3 | 11-11-2008 15:24:22 |
Campo vacio en dbf | lKinGl | Varios | 17 | 11-11-2008 15:21:28 |
un campo memo vacio? | NSL94 | SQL | 1 | 25-04-2007 13:05:35 |
|