RE: [PHP] PROBLEM

From: Date: Thu, 01 Aug 2002 08:47:10 +0000
Subject: RE: [PHP] PROBLEM
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110645@lists.php.net to get a copy of this message
> i have a problem in my project.the problem is that > suppose we have the date for the whole of the month > and two different files r there. > i have to pick one file of the current date that is > say today and the other file of the yesterday.but the > problem is that if the current date is monday then the > in yesterday file i have to pick for saturday and not > the sunday.broadly speaking i mean to say that the > difference between the today's date and yesterday's is > not fixed as there can be a holiday for say 4 days > inbetween then in yesterday i need the date 4 days > before. > so i need some query to handle this as soon as > possible as its very urjent.the query should be in > MYSQL.that is the query should be such which can pick > today's date and the date of the working day before > the today's or the current date. SELECT * FROM your_table WHERE your_date_column <= CURDATE() LIMIT 2 That assumes there is only one entry per day. Tell us if it's otherwise. ---John Holmes...

« previous php.general (#110645) next »