Posted by MS on 06/08/06 13:48
> Hi All, i want to check if a date is in between two other dates. like
> prevDate < testDate < nextDate. What is the query for this?
The answer depends on how your date is stored. If its stored as a timestamp
then
$result = ("SELECT * FROM tablename
WHERE ((date > '".$prevdate."') && (date < '".$nextdate."'))");
if you have a date in a date format i.e.... dd-mm-yyyy
you will need to rearrange the format into yyyymmdd and then dates are able
to be sorted in chronological order and the < and > operators will work !!
--
----------------------------------------------------------------------------
http://www.myclubweb.co.uk - The Home of Club Websites
----------------------------------------------------------------------------
Navigation:
[Reply to this message]
|