Re: Birthday calendar
Hi, This can be done using 3.23.49a, but it won't work, because the birthday year is somthing like 1981 and now() returns 2003. That is exactly the problem which I try to work out. \Olaf Peter Sap wrote: Hi Olaf, try something like this: AND gebdatum between now() and date_add(now(),interval 7 day) However, I have no idea if this can be done with 3.23.49a. -- Peter Sap. - Original Message - From: Olaf van Zandwijk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 17, 2003 5:39 PM Subject: Birthday calendar Hello, I want to have a query that returns the names from people that are having their birthday one of the coming 7 days. I currently have a buggy query that deals with this, but that query fails when the birthday is the next month, and we're now in the last week of the month before. Can anyone give me a hint in the right direction to do this? I'm using MySQL 3.23.49a, and it's not (yet) possible to use MySQL 4 Grtz, \Olaf SELECT month(gebdatum) AS maand, dayofmonth(gebdatum) AS dag, achternaam, CONCAT(roepnaam, ' ', COALESCE(tussenvoegsel, ' '), ' ', achternaam) AS naam FROM persoon, WHERE YEAR(gebdatum) IS NOT NULL AND This part of the query needs to be redone AND CONCAT(roepnaam, ' ', COALESCE(tussenvoegsel, ' '), ' ', achternaam) IS NOT NULL ORDER BY maand, dag, achternaam -- __XXX__ (0-0) +--ooO--(_)--Ooo---+ | | | Olaf van Zandwijk| | | | ICQ# 30231605| | PGP Public Key: http://www.vanzandwijk.net/pgp.txt | +--+ -- __XXX__ (0-0) +--ooO--(_)--Ooo---+ | | | Olaf van Zandwijk| | | | ICQ# 30231605| | PGP Public Key: http://www.vanzandwijk.net/pgp.txt | +--+
Birthday calendar
Hello, I want to have a query that returns the names from people that are having their birthday one of the coming 7 days. I currently have a buggy query that deals with this, but that query fails when the birthday is the next month, and we're now in the last week of the month before. Can anyone give me a hint in the right direction to do this? I'm using MySQL 3.23.49a, and it's not (yet) possible to use MySQL 4 Grtz, \Olaf SELECT month(gebdatum) AS maand, dayofmonth(gebdatum) AS dag, achternaam, CONCAT(roepnaam, ' ', COALESCE(tussenvoegsel, ' '), ' ', achternaam) AS naam FROM persoon, WHERE YEAR(gebdatum) IS NOT NULL AND This part of the query needs to be redone AND CONCAT(roepnaam, ' ', COALESCE(tussenvoegsel, ' '), ' ', achternaam) IS NOT NULL ORDER BY maand, dag, achternaam -- __XXX__ (0-0) +--ooO--(_)--Ooo---+ | | | Olaf van Zandwijk| | | | ICQ# 30231605| | PGP Public Key: http://www.vanzandwijk.net/pgp.txt | +--+ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
'0' instead of no entry with GROUP BY
Hi everyone, I've got a very simple table which contains records of events. It's just a table with 2 columns: an id and a timestamp. Every time this event occurs, I insert a timestamp in the table. I use this query to extract the number of events on each separate day: SELECT COUNT(id) AS number, FROM_UNIXTIME(UNIX_TIMESTAMP(stamp),%d-%m-%Y) AS date, FROM_UNIXTIME(UNIX_TIMESTAMP(stamp),%Y%m%d) AS sort FROM koffiestats GROUP BY date ORDER BY sort ASC This gives me something like this: +++--+ | number | date | sort | +++--+ | 5 | 02-07-2003 | 20030702 | | 7 | 03-07-2003 | 20030703 | | 6 | 04-07-2003 | 20030704 | | 5 | 07-07-2003 | 20030707 | | 2 | 08-07-2003 | 20030708 | | 5 | 09-07-2003 | 20030709 | +++--+ In this set of records, you see that there are days that nothing happened (this is usually in weekends and holidays).The problem is, that I want to see a '0' when no event occurred. Can I achieve this with a different query? Kind regards, \Olaf -- __XXX__ (0-0) +--ooO--(_)--Ooo---+ | | | Olaf van Zandwijk| | | | ICQ# 30231605| | PGP Public Key: http://www.vanzandwijk.net/pgp.txt | +--+ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connecting to MySQL on Linux from a Windows machine.
Hi, It seems to me that you can't connect to MySQL from an other machine at all. Did you start MySQL with the --skip-networking option? Try removing that option from the start-up scripts. \Olaf Will Merrell wrote: I cannot connect from my Windows machine to the MySQL database running on the Linux server. I have tried several different programs and they all report an error that says Lost connection to MySQL server during connection. I have read all the articles I can find and searched the archives as well as I can figure out but I am still stumped. Here are some pertinent details. 1) The Server is running Redhat 7.3 and MySQL 3.23.49. It is on my local network at 192.168.3.2 and there are no firewalls between it and the Windows machine. (Both are behind the same firewall, and completely open to each other.) 2) The Windows machine is running Win98 SE at 192.168.3.x (DHCP). 3) On the linux machine I can access MySQL just fine. The mysql command works, and I can serve web pages with PHP/MySQL content. 4) I can telnet, Samba, xterm, etc. to the linux machine just fine. I can telnet to port 80 and get a connection although it doesn't do much there. 5) I cannot telnet to port 3306. When I try, I get an immediate Host connection lost. error. Any ideas would be most appreciated. Thanks, -- Will - 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 -- __XXX__ (0-0) +--ooO--(_)--Ooo---+ | | | Olaf van Zandwijk| | | | ICQ# 30231605| | PGP Public Key: http://www.vanzandwijk.net/pgp.txt | +--+ - 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