[PHP-DB] sql and week starting ending numbers (dates)

2002-06-01 Thread Adam Royle
Hello all, I am creating a finance manager in php and mysql for my own accounting purposes (and to broaden my skills in php and sql) and I have a couple of pages where I view statistics on how much I spend, etc, and what patterns are formed from my spending. I have made a couple of pages

Re: [PHP-DB] sql and week starting ending numbers (dates)

2002-06-01 Thread Bogdan Stancescu
SELECT FROM_DAYS(TO_DAYS(purchaseDate)-DAYOFYEAR(purchaseDate)+WEEK(purchaseDate)*7) will hopefully return the date you need. You'll have to enclose all that in a DATE_FORMAT to get a printable date tho. Last minute note: you might have to subtract 1 from the last term because I guess MySQL