Solved

problem with TIMESTAMPDIFF the dates are stored in a column of database mysql and field time other column

Posted on 2013-12-13
3
634 Views
Last Modified: 2013-12-16
Hello syntax is
SELECT TIMESTAMPDIFF (MINUTE, '2003-02-01 ', '2003-02-05 12:05:55');
link
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff

but the problem is that the dates are stored in a column based on data type called start_date and enddate date and time this start_time and end_time separate call to the database, as I do to get the difference in minutes since
SELECT TIMESTAMPDIFF (MINUTE, start_date44 star_time44, end_date49 end_time49 from tbltok
0
Comment
Question by:controlit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 39719021
Are you saying that your dates and times are in seperate columns? If so you just combine them like so:
Select datecolumn, timecolumn, datecolumn+timecolumn from tablename
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 39719896
Hi!

This is how you can do this

SELECT TIMESTAMPDIFF (MINUTE, Timestamp(start_date44, star_time44 ) ,Timestamp( end_date49, end_time49)) from tbltok

Regards,
    Tomas Helgi
0
 

Author Closing Comment

by:controlit
ID: 39722441
tanks so much works perfectly
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question