Jay Roy
asked on
check if time is more than 24 hours
hi experts
I have a table Customer which has columns
ID Name LastLoggedIn LoggedInstatus
LastLoggedIn is a timestamp column
I want to come up with a sql which checks
if current time - LastLoggedIn > 24 hours THEN
update Customer set LoggedInstatus = false
basically the point is if customer is logged in more than 24
hours set the LoggedInstatus to false
trying to come up with sql , doesnt seem like working
update Customer set LoggedInstatus = false
where
select customer.LastLoggedIn - GETDATE() from Customer customer > 24
any help will be appreciated..
thanks.
I have a table Customer which has columns
ID Name LastLoggedIn LoggedInstatus
LastLoggedIn is a timestamp column
I want to come up with a sql which checks
if current time - LastLoggedIn > 24 hours THEN
update Customer set LoggedInstatus = false
basically the point is if customer is logged in more than 24
hours set the LoggedInstatus to false
trying to come up with sql , doesnt seem like working
update Customer set LoggedInstatus = false
where
select customer.LastLoggedIn - GETDATE() from Customer customer > 24
any help will be appreciated..
thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER