how to retrieve results where it is 2 years back with date format

hello there,

i have a problem with sql statement which i want to select the records from the past 2 years up until current date.

example:

-------------------------
name | startdate |
-------------------------
john | 2003-01-31 |
-------------------------
jay | 2003-01-31 |
-------------------------
mich | 2000-01-31 |
-------------------------

and i only want to retrieve the all the name results 2 years back from the current time "2004-05-31". need advise pls help.

thks much

Comments

  • : i have a problem with sql statement which i want to select the
    : records from the past 2 years up until current date.
    :
    : example:
    :
    : -------------------------
    : name | startdate |
    : -------------------------
    : john | 2003-01-31 |
    : -------------------------
    : jay | 2003-01-31 |
    : -------------------------
    : mich | 2000-01-31 |
    : -------------------------
    :
    : and i only want to retrieve the all the name results 2 years back from the current time "2004-05-31". need advise pls help.
    :
    Hmmm...maybe something like:-

    SELECT name
    FROM thetable
    WHERE startdate >= (NOW() - INTERVAL 2 YEAR)

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • : : i have a problem with sql statement which i want to select the
    : : records from the past 2 years up until current date.
    : :
    : : example:
    : :
    : : -------------------------
    : : name | startdate |
    : : -------------------------
    : : john | 2003-01-31 |
    : : -------------------------
    : : jay | 2003-01-31 |
    : : -------------------------
    : : mich | 2000-01-31 |
    : : -------------------------
    : :
    : : and i only want to retrieve the all the name results 2 years back from the current time "2004-05-31". need advise pls help.
    : :
    : Hmmm...maybe something like:-
    :
    : SELECT name
    : FROM thetable
    : WHERE startdate >= (NOW() - INTERVAL 2 YEAR)
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :
    Thanks much Jonathan, it worked. Really appreciates your advice and effort with this. Thanks much..
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories