I found it, 


mysql> select userID from user where datediff(now(), userPaymentDate)< 365;


Thanks

Rocío Gómez Escribano
r.go...@ingenia-soluciones.com


Polígono Campollano C/F, nº21T
02007 Albacete (España)
Tlf:967-504-513  Fax: 967-504-513
www.ingenia-soluciones.com

-----Mensaje original-----
De: Andrew Moore [mailto:eroomy...@gmail.com] 
Enviado el: jueves, 12 de mayo de 2011 17:11
Para: Rocio Gomez Escribano
CC: mysql@lists.mysql.com
Asunto: Re: operation with dates

Rocio,

there are specific date functions that you need to learn to allow you to
complete this kind of query. Please check out the MySQL documentation for
this.

HTH

Andy

On Thu, May 12, 2011 at 4:05 PM, Rocio Gomez Escribano <
r.go...@ingenia-soluciones.com> wrote:

> Hello! IÂ’m trying to subtract two dates in my consult, but I donÂ’t get it,
> I did:
>
>
>
>
>
>
>
> mysql> select userID from user where (userPaymentDate - now()) < 365 ;
>
>
>
>
>
> It didnÂ’t work. Do you know how to do it? Thank you so much!
>
>
>
> Regards
>
>
>
> *Rocío Gómez Escribano*
>
> r.go...@ingenia-soluciones.com <r.sanc...@ingenia-soluciones.com>
>
>
>
> [image: Descripción: cid:image002.jpg@01CB8CB6.ADEBA830]
>
> Polígono Campollano C/F, nº21T
>
> 02007 Albacete (España)
>
> Tlf:967-504-513  Fax: 967-504-513
>
> www.ingenia-soluciones.com
>
>
>



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to