Page 1 of 1

Need help in qriting mysql query

Posted: Fri Sep 07, 2007 8:29 am
by eshban
Hello,

Can anyone please help me in writing one query

Suppose today is 07th September 2007 and day is FRIDAY.

So on the base of today(which is friday), i want to get all Dates of Previous month friday's

so result should be

03-08-2007 - Friday
10-08-2007- Friday
17-08-2007- Friday
24-08-2007- Friday
31-08-2007- Friday

OR

if today is 09h September 2007 and day is Sunday.
So on the base of today(which is Sunday), i want to get all Dates of Previous month Sunday's

so result should be
05-08-2007 - Sunday
12-08-2007 - Sunday
19-08-2007 - Sunday
26-08-2007 - Sunday

please help that how to write mysql query of this

Posted: Fri Sep 07, 2007 8:56 am
by VladSun
You may use date_format() with %W