Manarak
Posts: 10
|
Posted: 07/10/2004, 3:07 AM |
|
Hello
I am working with php and mysql.
I have a table with the following fields:
last_contact (Mysql date format)
interv_time (mysql big integer format)
I would like to display only the records where
the number of days between the last_contact and the current date is greater than interv_time
can someone please help me to convert this into something codecharge or mysql understands? Ideally I would like to insert this into the "where" tab on codecharge.
thank you in advance
|
|
|
Manarak
Posts: 10
|
Posted: 07/10/2004, 3:12 AM |
|
1st unsuccessful trial:
Database error: Invalid SQL: select c.1name as c_1name, c.2name as c_2name, c.birthday as c_birthday, c.cid as c_cid, c.last_contact as c_last_contact from contacts c WHERE intval(strtotime(CURDATE())-strtotime(last_contact))/86400>interv_time
MySQL Error: 1064 (You have an error in your SQL syntax near '(strtotime(CURDATE())-strtotime(last_contact))/86400>interv_time' at line 1)
Session halted.
|
|
|
Manarak
Posts: 10
|
Posted: 07/10/2004, 3:16 AM |
|
I run Mysql 3.23
|
|
|
Manarak
Posts: 10
|
Posted: 07/10/2004, 3:18 AM |
|
2nd unsuccessful try:
Database error: Invalid SQL: select c.1name as c_1name, c.2name as c_2name, c.birthday as c_birthday, c.cid as c_cid, c.last_contact as c_last_contact from contacts c WHERE datediff(CURDATE(),last_contact)>interv_time
MySQL Error: 1064 (You have an error in your SQL syntax near '(CURDATE(),last_contact)>interv_time' at line 1)
Session halted.
probalby because I don't run MySQL 4.1.1 or greater?
|
|
|
Manarak
Posts: 10
|
Posted: 07/10/2004, 3:21 AM |
|
This one worked:
to_days(curdate())-to_days(last_contact)>interv_time
no help needed!
|
|
|
Walter Kempees
|
Posted: 07/20/2004, 6:46 AM |
|
Good job,
Walt
"Manarak" <Manarak@forum.codecharge> schreef in bericht
news:1440efc33a5b8d2@news.codecharge.com...
> This one worked:
>
> to_days(curdate())-to_days(last_contact)>interv_time
>
> no help needed!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
|