Groups | Blog | Home
all groups > sql server programming > june 2006 >

sql server programming : Stored Proc for FLU shots



Stephen K. Miyasato
6/13/2006 10:04:50 PM
I'm trying to finish this stored proc
Typically flu shot are give usually from Sept to Feb.
When Patient come in for a visit, the flags are updated on a fly. I need to
alter this stored proc for due date to start in September if the patient
comes this month for example June. Can anyone help with the logic?

Thanks

Stephen K. Miyasato
MDsync

if @StartDate is null
BEGIN
SET @StartDate = GetDate()
Update Flags
set
LastDate = @StartDate,

DueDate =GetDate()
from Flags
WHERE Rindex = @RIndex
END

Uri Dimant
6/14/2006 12:00:00 AM
Stephen
IF MONTH(GETDATE())=9
PRINT 'September'


---or

SELECT DATEADD(month,DATEDIFF(month,0,GETDATE())+months,0) AS d
FROM
(
SELECT 9-MONTH(GETDATE())AS months

) AS der




[quoted text, click to view]

AddThis Social Bookmark Button