Hi everyone, I'm very new at SQL so my knowledge is very limited. Therefore, all the details/examples I need to know to accomplish this would be greatly appreciated. Anyway, I was wondering if there was a way to create a job (that will run every week) that inserts a record into a database...which I've figured out how to do using the "Job" area in SQL EM, in fact, here's what I have -
INSERT INTO ProjMan (CustID, EntryDate, DueDate, DueTime, EmpEntered, Tech, ProjDesc, ProjType, Notes, IsCompleted) Values (1, '12/10/03', '1/2/04', '1/2/04 10:00:00 AM', 'Jamie', 'Jamie', 'Lito Report - auto insert','Job', 'no notes', 0)
But as you can see, my dates (and time) is 'hard-coded' in there. So my question is this: is there a way to automatically grab the current day and use it? Better yet, I would like this job to run every Sunday and actually have the date be for the coming up Tuesday, so i would need to add 2 days to the variable also if possible. If this isn't possible, I can just have the job run early Tuesday morning and insert it as the current day.
Thanks in advance for the help.Check BOL for functions getdate(), dateadd(), datepart(), etc.|||Thanks alot. I'll check it out.
No comments:
Post a Comment