View Single Post
  #6 (permalink)  
Old 01-06-09, 12:26
KevCB226 KevCB226 is offline
Registered User
 
Join Date: Sep 2005
Posts: 240
I tried adding a cursor to the query before, but it told me I couldn't do this due to the local variables.

This is what I did:

Code:
DECLARE overdue_cursor CURSOR
FOR SELECT @email = dbo.tblUsers.user_email, @notes = dbo.tblActions.acti_notes, @subject = dbo.tblActions.acti_subjectFROM dbo.tblActions
INNER JOIN dbo.tblUsers ON dbo.tblActions.acti_user_id = dbo.tblUsers.user_id
WHERE (dbo.tblActions.acti_complete = 0) AND (dbo.tblActions.acti_due_datetime IS NOT NULL) AND (dbo.tblActions.acti_due_datetime > GETDATE())

OPEN overdue_cursor
FETCH NEXT FROM overdue_cursor
__________________
<- Hides behind a rock.
Reply With Quote