OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

SQL TIME QUERY HELP

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> SQL TIME QUERY HELP
Page: [1]
 
webgyrl

 

Posts: 52
Joined: 2/9/2009
Status: offline

 
SQL TIME QUERY HELP - 4/26/2009 18:07:11   
i have a databse which saves the time when you enter a record i would like to know if anyone knows a query i could write that would subtract the time the record was posted from the current time and return the results like saying how long ago the record was posted
eg. 1 hr
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: SQL TIME QUERY HELP - 4/27/2009 10:09:10   
http://www.w3schools.com/vbscript/func_datediff.asp

_____________________________

:)

Follow us on TWITTER

(in reply to webgyrl)
webgyrl

 

Posts: 52
Joined: 2/9/2009
Status: offline

 
RE: SQL TIME QUERY HELP - 4/29/2009 12:12:39   
thanks!

(in reply to TexasWebDevelopers)
webgyrl

 

Posts: 52
Joined: 2/9/2009
Status: offline

 
RE: SQL TIME QUERY HELP - 4/29/2009 12:58:40   
hey thanks for responding...i got the script but unfortunately i am not sure how to go about it as i need it to be able to say minutes when it is less than an hour and hours once it has passed...is it possible for yyour to write me a sample that i may copy..thanks!!!!!!!!!!!!

(in reply to TexasWebDevelopers)
ddonaldson

 

Posts: 6
Joined: 3/20/2009
Status: offline

 
RE: SQL TIME QUERY HELP - 5/7/2009 12:52:38   
This should work:

Time Since: IIf(DateDiff("n",[Timestamp],Now())<60,DateDiff("n",[Timestamp],Now()) & " Minutes",DateDiff("h",[Timestamp],Now()) & " Hours")

[Timestamp] = your timestamp field in the database

If the number of minutes that have been passed is less than 60 then
display the minutes,
otherwise display the hours.

< Message edited by ddonaldson -- 5/7/2009 13:15:16 >

(in reply to webgyrl)
webgyrl

 

Posts: 52
Joined: 2/9/2009
Status: offline

 
RE: SQL TIME QUERY HELP - 5/18/2009 15:47:36   
thanks a bunch!

(in reply to ddonaldson)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> SQL TIME QUERY HELP
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts