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
606 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
3 Comments
 
LVL 38

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now