2 messages in com.mysql.lists.win32Re: Trying to get Monday's date with ...
FromSent OnAttachments
rob spijkerman16 Feb 2003 14:47 
Ignatius Reilly17 Feb 2003 00:38 
Subject:Re: Trying to get Monday's date with a known week number.
From:Ignatius Reilly (igna@free.fr)
Date:02/17/2003 12:38:21 AM
List:com.mysql.lists.win32

Hi,

(Disclaimer: I hate Mondays.)

You can try this:

1. Select all days of the current year that belong to the current week or a previous one (you can do a cross-join of a "months" table ( 01..12) and a "days" table ( 01..31 ) created for this purpose - anyway those are always useful auxiliary tables to have around)

2. Select the max date thereof which is a Monday ( DAYOFWEEK() function)

HTH Ignatius

____________________________________________

----- Original Message ----- From: "rob spijkerman" <rob.@alliedtelesyn.co.nz> To: <win@lists.mysql.com> Sent: Sunday, February 16, 2003 11:47 PM Subject: Trying to get Monday's date with a known week number.

Hi all

This problem is proving to be somewhat vexing.

I am trying to create a function that will return mondays date with the only input being the known week number.

I am using MYSQL and PHP, but looking through the MYSQL Date Time functions in the manual I cannot see any reason why I cannot derive this value with the MySQL query itself. Does anyone have any suggestions on the best way to achieve this.

Kindest Regards

Rob Spijkerman

------------------------------------------------------------- Rob Spijkerman 27 Nazareth Avenue Senior Software Engineer PO Box 8011 Allied Telesyn Research Christchurch Phone +64 3 339 3000 New Zealand DDI +64 3 339 9569 Email: rob.@alliedtelesyn.co.nz Fax +64 3 339 3001 web: http://www.alliedtelesyn.co.nz/

-------------------------------------------------------------