Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate duration of session 1

Status
Not open for further replies.

charanch

Programmer
Jan 3, 2004
55
US
Hello,

I have a table that collects the username and date/time they logged in and logged out and the session id. How would I calculate the duration of their visit?

Thanks for your help!

charles
 
MS SQL has a datediff function. This gives the difference in seconds:

select datediff( n, login, logout)
from logtimes

hth,
Foxbox
ttmug.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top