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
599 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 24

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

18 Experts available now in Live!

Get 1:1 Help Now