Answered
help with Command - Stored Procedure
Hi all,
I'm having a great deal of difficulty getting my head around an update command / stored procedure, I've pulled out all of my books and spent the last two days on Google which has made my confusion worse. In simple terms what I'm trying to do is update a field in a table with the value y, but based on certain criteria. So my table has the following fields -
JBAID
JBASiteID
JBADatePosted
JBAPostFor
JBANotified
What i want to do is update the value of field JBANotified on all records that meeting the following criteria to Y
The criteria is -
WHERE DATEADD(d,JBAPostFor,JBADatePosted) BETWEEN DATEADD(d, -7, GETDATE()) AND GETDATE() AND JBANotified = 'n' AND JBASiteID = MMColParam (where MMColParam is Session("SITEID"))
So I've just tried building a command / stored procedure - which reads (see attached code)(more than likely all wrong)
The things that I cant get my head around are -
Firstly getting the code right in the first place, running the command on page load and then when the command has run redirecting to the next page.
I really would appreciate some help with this -
thanks all
I'm having a great deal of difficulty getting my head around an update command / stored procedure, I've pulled out all of my books and spent the last two days on Google which has made my confusion worse. In simple terms what I'm trying to do is update a field in a table with the value y, but based on certain criteria. So my table has the following fields -
JBAID
JBASiteID
JBADatePosted
JBAPostFor
JBANotified
What i want to do is update the value of field JBANotified on all records that meeting the following criteria to Y
The criteria is -
WHERE DATEADD(d,JBAPostFor,JBADatePosted) BETWEEN DATEADD(d, -7, GETDATE()) AND GETDATE() AND JBANotified = 'n' AND JBASiteID = MMColParam (where MMColParam is Session("SITEID"))
So I've just tried building a command / stored procedure - which reads (see attached code)(more than likely all wrong)
The things that I cant get my head around are -
Firstly getting the code right in the first place, running the command on page load and then when the command has run redirecting to the next page.
I really would appreciate some help with this -
thanks all
