torkil,
Monday, March 04, 2002, 10:57:50 AM, you wrote:
tj> I have a database table containing log files that are written by
tj> different individuals almost every day.
tj> So at any given time I want to be able to go through a web
tj> interface and get a list over logs written in any given month.
tj> People writing in this log also work in different department,
tj> a field also included in the log.
tj> Timestamps for the log is stored as datetime on the format
tj> "YYYY-MM-DD HH:MM:SS"
tj> So I want to make the following selection:
tj> "Show me all log entries for department X for the given month"
tj> So how would I go about to do write this query in the easiest
tj> way, given that I provide the year and month I want to view
tj> before the query is made?
tj> select * from LOG_TABLE where DEPARTMENT='X' ..... ..... ..... ???
There are many date and time functions, it will be useful for you.
Look at:
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
tj> - Torkil
--
For technical support contracts, goto https://order.mysql.com/
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php