I am trying to create the syntax (stored procedure) that will allow me to first check the status of a given date field, and if that date field is OLDER than 1 year (365 calendar days), I'll print out a statement and update the appropriate table(s).
Can anyone assist me with this task?
Here is a sample of the syntax I have so far:
CREATE PROCEDURE [spCheck_LastUpdate]
@last_updated datetime
AS
(SELECT B.last_updated from t_candidate1 B where last_updated = @last_updated)
*The above syntax I have only performs the 'check' on the last_updated field. How do I show or check to see if this last_updated field is older than 1 year?
Thanks in advance,
Claude Johnson
cjohnson@staffmentor.net
Can anyone assist me with this task?
Here is a sample of the syntax I have so far:
CREATE PROCEDURE [spCheck_LastUpdate]
@last_updated datetime
AS
(SELECT B.last_updated from t_candidate1 B where last_updated = @last_updated)
*The above syntax I have only performs the 'check' on the last_updated field. How do I show or check to see if this last_updated field is older than 1 year?
Thanks in advance,
Claude Johnson
cjohnson@staffmentor.net