Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a Field Based on DATEDIFF

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a field called STATUS. I'm trying to run a procedure that will update the field STATUS if the below code results are > 8 days


Code:
 SELECT        

DATEDIFF(DAY, DATE_FIELD, GETDATE()) AS DAYS_IN_QUE

FROM

TABLE

any help would be appreciated

thanks
 
Code:
UPDATE YourTable SET Status = ????
WHERE DATEDIFF(DAY, DATE_FIELD, GETDATE()) > 8

Is this what you want?

Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top