dates greater less than

0
Buneas, someone knows in mysql in a query to bring you a date given in the future and put this but it also brings me 2018-10-20 and 2018-09-25

 SELECT idval_val AS id, val_fecha_registro AS fecha_registro, val_nom_contacto AS contacto_nombre, val_aps AS aps, val_id_ase AS ase, val_ciudad AS ciudad
FROM contacto
WHERE val_ciudad =  'cu'
AND val_fecha_registro >=  '2018-10-29'
AND val_id_ase =  '710'

If I put it like that, it only returns 3 records but they are from 2018-11-01 val_fecha_registro is type date

    
asked by Juan Jose 02.11.2018 в 01:07
source

1 answer

0

may be because the date is passed as a string, one solution would be to perform the conversion to the date type

WHERE val_ciudad =  'es'
AND CONVERT(val_fecha_registro,DATE) >=  CONVERT('2018-10-29',DATE)
AND val_id =  '710'

I hope this is

    
answered by 02.11.2018 в 01:14