Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I have a customeinfo table in which i want to select all the records whose time stamp is greater than 24hrs

My calculation will be

CustomerInfoTimeStamp = (CurrentTime-LastUpdated) 

if(CustomerInfoTimeStamp>24hrs)
{

select * from customerInfo where time=CustomerInfoTimeStamp
}


Regards
Posted
Updated 16-Jun-14 17:58pm
v2
Comments
DamithSL 17-Jun-14 0:08am    
what is the column data type of time column?
do you have last updated time in your database?
richa11 17-Jun-14 0:13am    
yes i have lastUpdatedTime in my database and from that I want to calcilate

1 solution

Why not...

select * from customerInfo where datediff(hh,GETDATE(),LastUpdated)>24

Best to use SQL rather than program code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900