469,344 Members | 6,209 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

DATEDIFF in Mysql 4.0

Dear All,

The following query is not working in Mysql 4.0
Expand|Select|Wrap|Line Numbers
  1. SELECT DATEDIFF(
  2. '2007-08-27', '2007-08-17'
But this query is working in MySQL 4.1.15.

What should i do to find the date difference in Mysql 4.0 But the date format query is working
ie
Expand|Select|Wrap|Line Numbers
  1. SELECT DATE_FORMAT(Dt,'%d-%m-%Y') FROM Product_Master
.

Kindly provide the solution.

Thanks in advance.

Best Regards,
Madhumadhi.S
Aug 28 '07 #1
2 5091
mwasif
801 Expert 512MB
Kindly use appropriate CODE tags when posting code.


Use can use TO_DAYS(). It returns a day number (the number of days since year 0).
Expand|Select|Wrap|Line Numbers
  1. SELECT TO_DAYS('2007-08-27') - TO_DAYS('2007-08-17')
Aug 28 '07 #2
Hi,

Thanks a lot.
It's working fine

Best Regards,
Madhumadhi.S
Aug 31 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by inamori | last post: by
6 posts views Thread by Lofty | last post: by
4 posts views Thread by Paolo | last post: by
6 posts views Thread by kevinjwilson | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.