Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
Databases
11:03 pm Jul 10, 2026
This page requires javascript.
Forum Moderators:
open
Message Too Old, No Replies
Subtracting Dates in MySQL
Can you subtract one datetime rows from another datetime place?
sawatkins
Msg#:3643224
7:30 pm on May 6, 2008
(gmt 0)
The title pretty much says it all. I have two rows formatted in datetime. Can I subtract one from the other, like
SELECT DATE_SUB(`endtime`, `starttime`)
Thanks in advance for the help!
</g>
ashish21cool
Msg#:3643614
7:09 am on May 7, 2008
(gmt 0)
try to subtract using "-"
Datetime1 - Datetime2
Let me know if this solves you problem.
rocknbil
Msg#:3644125
6:49 pm on May 7, 2008
(gmt 0)
Sure you can, but I think you are looking for
datediff()
[dev.mysql.com]
or
timediff()
[dev.mysql.com].
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Jun
,
May
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
July 2026 Google Search Observations
AI = New incoming wave of unemployment?
AdSense Earnings and Observations - July 2026
Annoying Crawler, Bot, or what?
How Would Someone Lock Onto A PDF
What strategies work to produce AI share of access?
Structuring Performance-Based Digital PR For Link Building
Do anything special today?
June 2026 Google Search Observations
Home
Forums Index
Server Side
/
Databases
11:03 pm Jul 10, 2026