472,096 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

DATEDIFF in Mysql 4.0

Dear All,

The following query is not working in Mysql 4.0
Expand|Select|Wrap|Line Numbers
  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
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,
Aug 28 '07 #1
2 5271
802 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

Thanks a lot.
It's working fine

Best Regards,
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.