Hi All
I've not been able to find a good answer to this or figure out what would be the best approach - bear in mind I am a beginner.
I have tried the following
> USE databas
> SELECT Item_A AS 'Something 1',
> Item_B AS 'Something 2',
> Item_C AS 'Something 3',
> INTERVAL 6 MONTH + Item_B AS 'Something 4',
> BEGIN IF CURDATE() >= INTERVAL 6 MONTH + Item_C THEN SELECT INTERVAL 12 MONTH + Item_C
> [ELSEIF CURDATE() >= INTERVAL 12 MONTH + Item_C THEN SELECT INTERVAL 18 MONTH + Item_C]
> ELSE INTERVAL 6 MONTH + Item_C)
> END IF
> FROM Table ;
What I want to do is;
I have a post "Item_C" which is a date. Six months after Item_C an event occurs (lets call it "The Event") , and continues to occur every six months untill the post Item_C recives Status NULL.
I need to be able to extract from the database the following info and I will explain it in an example;
Say on May 1 I would like to find out what if any instances of "The Event" are occuring during the month of may and the next month. If the original Item_C has the date 2003-01-01, the "The Event" has/will occurr on 2003-07-01 and on 2004-01-01 and on 2004-07-01 etc. In order for me to discover on June 1 2004 that the "The Event" will occur 2004-07-01 I need to do a calculation on the original date 2003-01-01 and present the relevant date 2004-07-01 at the relevant time and at the same not including any Item_C which has status NULL.
I tried to do this with the above example - which I am sure all you knowledgeable people can see is kludge at best...I am prepared to figure this out on my own but I am having difficulty grasping the appropriate methodology here. Hence any and all help will be much appreciated.
Thomas
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]