DelphiFAQ Home Search:

Compare 2 dates in mysql

 

comments6 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.

Question:

I need to compare 2 dates in mysql but I only have version 3.23 of mysql installed and cannot upgrade.

Answer:

With mysql 4.1.1 the function datediff(date1,date2) and others were introduced.

If you are using 4.0 or older, you need to use to_days(date1) and subtract in this form:

select TO_DAYS(NOW()) - TO_DAYS(last_modification)
from mytable;

Content-type: text/html

Comments:

2006-09-01, 03:03:22
anonymous from India  
hey its not date_diff, its datediff(date1, date2) in the latest versions of mysql...
2009-03-24, 01:30:17
anonymous from Singapore  
thanks, really needed to find out how to calculate the date diff for older sql version but most guides online is teaching datediff which is only supported in the newer version of mysql.
2009-03-27, 06:44:18
anonymous from India  
very good my son ,carry on....
2009-04-29, 11:55:05
anonymous from Lesotho  
rating
2017-08-23, 02:15:58
anonymous from Indonesia  
=RAHASIA MENHASILKAN UANG BERLIMPAH= ====RATUSAN RIBUH HINGGA JUTAAN RUPIAH BAHKAN SAMPAI RATUSAN JUTA=== ====TIAP HARI DENGAN BANTUAN NYAI-RONGGENG HU 0821-8948-1547=====

JIKA ANDA SUDAH CAPE DAN LELAH DENGAN STATUS P7-PERGI PAGI PULANG PETANG PENGHASILAN CUMA PAS-PASAN DAN TIDAK TAU HARUS BAGAIMANA LAGI UNTUK MENINGKATKAN KONDISI FINANSIAL KEUANGAN ANDA…MAKA SAYA MINTA SEGERA HUB NYAI-RONGGENG DI 082-189-481-547 BELIAU PASTI MEMBANTU ANDA SAMPAI ANDA SUKSES,SPERTI SAYA.KEHIDUPAN SAYA YANG DULUNYA SUSAH SEKARANG SUDAH SERBA BERKECUKUPAN BERKAT BANTUAN DARI NYAI RONGGENG.ANDA PASTI SUKSES JIKA UDAH DI BANTU AMA NYAI RONGGENG SEGERA SAJA HUB BELIAU JIKA ANDA UDAH CAPE HIDUP SUSAH.

DAN DI SINI PULA ANDA BISA MENGHASILKAN DANA CEPAT DENGAN CARA YANG LAIN ATAU DENGAN KATA LAIN
PESUGIHN TUYUL
UANG GAIB
ANKA GAIB
DAN PESUGIHAN PUTIH TANPA TUMBAL
This image was also posted here:
The UK NATIONAL LOTTERY scam
The UK NATIONAL LOTTERY scam
How to run a *.sql script (mysql)
Dating scammer Rose James
DelphiFAQ Site wide search function
Various dating scammers
mysql: How can I rename a database
How can I rename table names and column names in mysql
How can I obtain the next auto_increment number (before inserting a record)?
Lock an entire mysql database with all its tables



Keywords:
2017-08-24, 02:50:54
anonymous  
Tersesat pengisap ayam kampung inchi indonesia.

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: