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
610 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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