Click here to Skip to main content
15,791,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I was saved several data in database and categorized the both data in the table based on time when it entered.24hrs data in the table status will change as "Overdue" and other data status are "Open".how it set.
Jameel VM 24-Sep-14 2:01am    
did you try Sql Server Scheduled Job?

It's better to use SqlServer scheduled job to achieve this functionality.Please try this link for creating Scheduled Job[^]
Hope this helps
Share this answer
You can create jobs in SQL Server, no C# or JQuery. Similar to windows scheduler, you create a job that will run daily at fixed time (or several times a day). This job executes one or more commands (can be calls to stored procedures).

See here for details[^]

In that job you would call

UPDATE your_table 
    status = "Overdue" 
    DATEDIFF('hh', date_entered , GetDate()) > 24

Note that I wrote datediff from memory, order of parameters may be different

If this helps, please take time to accept the solution so that other may find it. Thank you.
Share this answer
[no name] 24-Sep-14 3:29am    
k,the status changed to overdue,but at that time how we send a automatic mail to admin.
Sinisa Hajnal 24-Sep-14 3:35am    
SQL Server can send e-mails if you set it right. Google a bit. There is a system stored procedure for that.

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