Page 1 of 1
how to compare date using sql???
Posted: Sun May 10, 2009 8:17 am
by rrn
Hi all ,
in my database there are rows of date in the form dd-mm-yyyy
wat i want to do is?
i want to leave a space after different years..ie
if the table is
22-09-2004
06-06-2004
25-12-2005
03-02-2005
17-02-2008
it should be like this
22-09-2004
06-06-2004
25-12-2005
03-02-2005
17-02-2008
how will i compare the years using php code??
Re: how to compare date using sql???
Posted: Sun May 10, 2009 9:08 am
by codex-m
rrn wrote:Hi all ,
in my database there are rows of date in the form dd-mm-yyyy
wat i want to do is?
i want to leave a space after different years..ie
if the table is
22-09-2004
06-06-2004
25-12-2005
03-02-2005
17-02-2008
it should be like this
22-09-2004
06-06-2004
25-12-2005
03-02-2005
17-02-2008
how will i compare the years using php code??
Yes it will be easy to compare, what exactly do you need to accomplish in the comparison test? Did you need to compare which dates are older or earlier? Also, why you need to add space in your MySQL table? I think you do not need that. All you need is pull data from MySQL database and compare it using PHP.
Re: how to compare date using sql???
Posted: Mon May 11, 2009 4:07 am
by rrn
ya...i want to compare it using php..i tried many codes but didnt work..can u pls give me a solution...
Re: how to compare date using sql???
Posted: Mon May 11, 2009 9:10 am
by codex-m
rrn wrote:ya...i want to compare it using php..i tried many codes but didnt work..can u pls give me a solution...
Can you please paste some of your code that did'nt work, we will try to determine what's wrong with it. Thanks.