What is wrong in this time difference query?
I use MYSQL TO_DAYS function to grab some statistics from database and I use next statement: SELECT ID FROM database WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) =7 ORDER BY ID DESC I have IIS server and I use Dreamweaver MX to build the statistics page, where we use ASP. Problem is, that I get row from every month with date difference of 7 instead of rows from last seven days. What went wrong? Do I have to specify the date format someway to the TO_DAYS function? Sincerely, Putte Koivisto - 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
How to easy delete old records from sql database
Is there any easy way to delete records from database, wich logs user activity at website? I mean, if there is somekind of limit for rows in table. And if limit is exceeded, older rows will be automaticly deleted, or even better, moved to another table. Is there any query to make this happen? Sincerely, Putte Koivisto - 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
How to make INNER JOIN right?
Hi there, I have two tables wich I need to join together. I use INNER JOIN but there is one problem. I have a master table, where is a column where I have a WHERE clause, wich I use as criterion for SELECT. The second table has some details for rows, wich fulfil the WHERE clause. I have an ID for rows, wihc are the same in both tables. Problem is, that if I remove a row from secondary table, it does not come to query results any more, and I need to have all rows from master table even if there is no rows in secondary table. Sincerely, Putte Koivisto - 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
How to use comma instead dot in numeric values?
Is there a simple solution to define MySQL to use comma instead of dot in numeric fields? Sincerely, Putte koivisto - 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