 |
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: newbie sql replace
The Following would be closer:
"UPDATE Exam SET ExamData = 'C:' WHERE ExamData = 'P:'"
Although I don't know if it'd work in Access.
|
|
07-09-2002 at 05:57 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: newbie sql replace
UPDATE [Exam] SET [ExamData] = 'P' & Right(ExamData,Len(ExamData)-1) WHERE left(ExamData,1) = 'C'
The above would change all records that start with "C" to "P"
IE: if record is: "C:data123.exm" it will become: "P:data123.exm"
This works in Access XP as stated, in 2000 may, not sure in earlier versions.
[Edited by JLRodgers on 07-09-2002 at 11:23 PM GMT]
|
|
08-09-2002 at 05:22 AM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: newbie sql replace
The "replace" was generated by access?
Strange if so, the only references to "Replace" in my access help is how to search and replace, and how to using the "UPDATE" command. searching for "Replace(" returns nothing. Although if it did work, you may have the problem listed below in the example.
However in SQL Server, the Replace command will work (but it wouldn't be good to use given what you wanted)
ex (In SQL Server):
SELECT Replace('abc:xxdatac.xlc','c', 'p')
Will return: abp:xxdatap.xlp
So if your data had a "c" in it anywhere other than the first character, the "Replace" would've messed it up.
|
|
09-09-2002 at 12:37 PM |
|
|
|
|
 |
 |