SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 24th, 2000, 02:52 AM
Amit Amit is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 6 Amit User rank is Private First Class (20 - 50 Reputation Level)Amit User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Amit
I have to calculate time difference using sql statements in MySQL. Can somebody please tell me the syntax for it.

Reply With Quote
  #2  
Old April 24th, 2000, 10:08 PM
Kyuzo Kyuzo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Annapolis, Maryland US
Posts: 113 Kyuzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
There are many different time manipulation functions for valid datetime columns - just check on MySQL's online manual.

A personal favorite is the to_days() function....

> select * from table_name
> where to_days(now())-to_days(activity_date)
> <= 7;

// show me all the activities that occurred within the last week.

Reply With Quote
  #3  
Old April 28th, 2000, 08:21 AM
ranjeet ranjeet is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: thane
Posts: 50 ranjeet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ranjeet Send a message via Yahoo to ranjeet
yaar amit

wht exaclty is ur requirement ?

wht time diff u wanna measure?

to_days() is always a good option ..

give some more details like wht do u want

ranjeet walunj

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > time difference


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway