473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Seconds/Hours/Days etc.. since user last visited

I want to make a table that lists the Seconds / Hours / Days since the user
last visited my site, just like the myPHPnuke systems have, but I dont know
the best way to go about it.

At the moment when the user calls the page the database is updated with the
current date/time for that user.

Should I do this in the VB code in the page or write a SQL statement to do
this?

I have tried in SQL to do this and partly succeeded. Ideally I want it do
display the time in seconds if less than 60 seconds since a visit, minutes
if less than 60 minutes, hours if less than 24 and days if otherwise.

tdi1686

Nov 17 '05 #1
2 1715
Forgot to mention that my DB is Access 2000, so that may restrict the SQL.
"tdi1686" <td*****@coldmail.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl...
I want to make a table that lists the Seconds / Hours / Days since the user last visited my site, just like the myPHPnuke systems have, but I dont know the best way to go about it.

At the moment when the user calls the page the database is updated with the current date/time for that user.

Should I do this in the VB code in the page or write a SQL statement to do
this?

I have tried in SQL to do this and partly succeeded. Ideally I want it do
display the time in seconds if less than 60 seconds since a visit, minutes
if less than 60 minutes, hours if less than 24 and days if otherwise.

tdi1686

Nov 17 '05 #2
It would really be better in terms of performance to simply get the
TimeStamp from the database raw, and then use code in your app to get the
parts out of it. If you do want to split it up in your SQL, you could do
something like the following:

SELECT Year(someDate) As YearPart, Month(someDate) As MonthPart,
Day(someDate) As DayPart, Hour(someDate) As HourPart,
Minute(SomeDate) As MinutePart, Second(someDate) As SecondPart
FROM someTable

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"tdi1686" <td*****@coldmail.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Forgot to mention that my DB is Access 2000, so that may restrict the SQL.
"tdi1686" <td*****@coldmail.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl...
I want to make a table that lists the Seconds / Hours / Days since the

user
last visited my site, just like the myPHPnuke systems have, but I dont

know
the best way to go about it.

At the moment when the user calls the page the database is updated with

the
current date/time for that user.

Should I do this in the VB code in the page or write a SQL statement to do this?

I have tried in SQL to do this and partly succeeded. Ideally I want it do display the time in seconds if less than 60 seconds since a visit, minutes if less than 60 minutes, hours if less than 24 and days if otherwise.

tdi1686


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: NotGiven | last post by:
I am guessing I would hold a variable of when it's opened, then in the script that runs when the page is offloaded, I coudl calcualte it. How do you store a time variable? How do you calculate...
6
by: Kription | last post by:
Hello, I am having a nightmare of a time getting seconds converted to hour-minute-seconds I have a third party application that outputs only in seconds since so if someone has been logged...
7
by: Stu | last post by:
Is there a simple function call within "C" that I can use to convert number of seconds (keep in mind this may be a type longlong and has to work on UNIX and NT) into Days, months, Hours, Minutes...
3
by: nriesch | last post by:
In the documentation, the "Second" property of class DateTime is a value between 0 and 59. In UTC time, approximately every year of so, a leap second is added at 00:00:00 UTC, so as to account...
5
by: WRACK | last post by:
Hi, I am trying to make a function which accepts Seconds as an argument and returns them into Days, Hours & Seconds format and can't seem to make it working. Can someone please help me to...
5
by: Nikeman | last post by:
good day, I simply would like to know as to how I can parse seconds to convert them into equivalent DateTime representation. To be more persice, I have a DirectShow app written in VB.NET, with a...
1
by: Liviu BURCUSEL | last post by:
Hello ! It is late night and I cannot think right anymore. Please help me to convert a interval like '2 days 00:22:10.2905' in seconds. Thank you very much in advance, Liviu ...
6
by: alexs | last post by:
hi, I'm moving a mysql database over to using db2 V9.5 The database is used by our radius server to store network accounting information from our switches. One parameter is the length of a...
5
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have about ten integer values that each need to be converted to days, hours, minutes and seconds. I can't seem to find a formula for same that works. These integer values come from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.