Showing entries 1 to 1
Displaying posts with tag: all days mysql (reset)
MySQL function returns dates of specified day & between date range

This mysql stored function will return you all the dates between given dates having specified day. In short if you say: give me all Sundays in this month. I have following for you: mysql> select Give_Me_Dates_Days(1,'2012-09-01','2012-10-01') as All_Sundays; +--------------------------------------------------------+ | All_Sundays | +--------------------------------------------------------+ | 2012-09-02,2012-09-09,2012-09-16,2012-09-23,2012-09-30 | +--------------------------------------------------------+ The function parameters are as follows: Give_Me_Dates_Days(DAY_IDENTIFIER,START_DATE,END_DATE) Sunday = 1 (and rest you can figure-out). [ Ofcourse I’ve not done much validations eg. start_date The post MySQL function returns dates of specified day & between date range first appeared on …

[Read more]
Showing entries 1 to 1