Ahh, how tricky this could be.  Don't you wish we had a decimal system of time?

Frankly, I think that doing this strictly with SQL would be near-impossible, but
I am by no means an SQL guru.  If this data is for final presentation via a
website, I'd suggest looking into PHP or PERL, either of which will facilitate
much more complex processing of your data.  However, if someone can explain how
to do this strictly with SQL, I would be impressed.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


----- Original Message -----
From: "kallwn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, 05 June, 2003 15:47
Subject: finding the 1st 2nd 3r or 4th DOW of a month


I have a database in mySQL that I use to keep track of phone calls to my
company. I've been able to query the database and get the information  I
need until now and being pretty much a self taught novice to sql I'm
somewaht stumped. What I want to do is to compare specific days of the week
in a month to the same month from previous year. An example would be that I
would want to compare the 3rd Thursday in May to the 3rd Thursday in May one
or even two years ago.

What I have been doing is something like:
select *

from mytable

where dayname(dateint) = 'Thursday' and week(dateint) = "10"



However this does not seem to always give me the results I'm expecting. Does
anyone have any suggestions?



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to