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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automated date checking

Status
Not open for further replies.

ANDYCHARGER

Programmer
Joined
Oct 8, 2003
Messages
5
Location
GB
Hi,

I need to check 2 dates in a table and if they are more than 5 working days apart flag it on my system.

I guessed the easiest way to do this would be to create an automated process in SQL server that checks all records in the table where the workingdays are greater than 5.

Can someone tell me or point me in the right direction for this and where in SQL server I can create automated processes?
 
I am assuming that each record has 2 date fields you are comparing. If that is so ... the syntax would be something like ...

declare @FlagIt bit
set @FlagIt = 0

IF DateDiff(day,Date1,Date2) > 5
SET @FlagIt = 1

Thanks

J. Kusch
 
So where do I set up this to run at say, 12pm every day?
I would also need to get the results out again and mail them.

 
Looks like you need to create a scheduled DTS package.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top