![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi I have a problem with mysql querry SELECT * FROM viewfor_prop_for_search WHERE createdon BETWEEN NOW() AND NOW() + INTERVAL 20 day; i try get rows added in last 20 days. creadon is datetime type Why it doesn't work Sebastian | |||
| Advertisements |
| | #2 | ||
| Sebastian wrote: > Hi > > I have a problem with mysql querry > > SELECT * FROM viewfor_prop_for_search WHERE createdon BETWEEN NOW() > AND NOW() + > INTERVAL 20 day; > > i try get rows added in last 20 days. > > creadon is datetime type > > Why it doesn't work > > > Sebastian Because now plus 20 days is 20 days from now! E.g. now is Friday. Now plus 2 days is Sunday. Get the idea? | |||
| | #3 | ||
| > Because now plus 20 days is 20 days from now! > > E.g. now is Friday. Now plus 2 days is Sunday. > > Get the idea? Hehe, i make mestake, but with minus is doesn't work to | |||
| | #4 | ||
| == Quote from Sebastian (haja.sebastian@gmail.com)'s article > > Because now plus 20 days is 20 days from now! > > > > E.g. now is Friday. Now plus 2 days is Sunday. > > > > Get the idea? > Hehe, i make mestake, but with minus is doesn't work to i just tried this on a timestamp field and it didn't work either. -- POST BY: lark with PHP News Reader | |||
| | #5 | ||
| Sebastian wrote: >> Because now plus 20 days is 20 days from now! >> >> E.g. now is Friday. Now plus 2 days is Sunday. >> >> Get the idea? > > Hehe, i make mestake, but with minus is doesn't work to Well I don't know why lark couldn't get it to work but I just tried: SELECT * FROM `viewfor_prop_for_search` WHERE `createdon` BETWEEN NOW() - INTERVAL 20 DAY AND NOW(); and it worked fine. Could you post an extract from your table (the create statement and some inserts) and your query so I can see what's wrong. | |||
| Featured Websites | ||||
|
![]() |
| Tags: mysql, querry |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can't logon to db with mysql client: mysql 5 passwords | rog | Database | 2 | 07-01-2007 9:31 PM |
| ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) | Cteodor | Database | 0 | 07-01-2007 6:43 PM |
| [Periodic Charter Post] comp.databases.mysql - MySQL RDBMS technical discussions. | Gary L. Burnore | Database | 0 | 07-01-2007 6:27 PM |
| MySQL Query Cache Not Working: MySQL 5 / Windows XP | Good Man | Database | 0 | 07-01-2007 6:25 PM |
| MySQL Query Cache Not Working: MySQL 5 / Windows XP | Good Man | Database | 0 | 05-31-2007 8:46 PM |
| Featured Websites | ||||
|