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