DebHanleyRI
Programmer
I either add or update a field based on whether or not data exists in that field.
Example: I am looking for the following "<<<Recondo Received 9/28/10>>>" in a text field
The field may look like this:
CoPay required <<<Recondo Received 9/28/10>>> no gado
Using the following fails if the "<<<" does not exist. It actually wipes out everything in the appointment note
SET @ApptNote1 = LEFT(@AppointmentNote, CHARINDEX('<<<', @AppointmentNote)-1)
SET @ApptNote2 = RIGHT(@AppointmentNote, CHARINDEX('>>>', REVERSE(@AppointmentNote)-1))
print @ApptNote1
print @ApptNote2
UPDATE rlogic.exams
SET appointmentNote = @ApptNote1 + @ApptNote2 + @recstate where accession_no = @accessionno
not all who wander are lost....
Example: I am looking for the following "<<<Recondo Received 9/28/10>>>" in a text field
The field may look like this:
CoPay required <<<Recondo Received 9/28/10>>> no gado
Using the following fails if the "<<<" does not exist. It actually wipes out everything in the appointment note
SET @ApptNote1 = LEFT(@AppointmentNote, CHARINDEX('<<<', @AppointmentNote)-1)
SET @ApptNote2 = RIGHT(@AppointmentNote, CHARINDEX('>>>', REVERSE(@AppointmentNote)-1))
print @ApptNote1
print @ApptNote2
UPDATE rlogic.exams
SET appointmentNote = @ApptNote1 + @ApptNote2 + @recstate where accession_no = @accessionno
not all who wander are lost....