Hello,
I am wondering why this update query won't work for me?
UPDATE Producer_World SET Producer_World.Body = " "
WHERE (((Producer_World.Body)=Left([Body],InStr([Body],"Date Request"))));
Thanks
Hello,
I am wondering why this update query won't work for me?
UPDATE Producer_World SET Producer_World.Body = " "
WHERE (((Producer_World.Body)=Left([Body],InStr([Body],"Date Request"))));
Thanks
does the SELECT query return values based on:
WHERE (((Producer_World.Body)=Left([Body],InStr([Body],"Date Request"))));
if not, nor will the update query.
Perhaps you could explain exactly what it is supposed to do and post some of your data?
Yes it does. It returns everything left of "Date Request"
I want it to delete everything left of "Date Request" in the field "Body"
I am confused by your criteria.
You are comparing the Body field to itself?
I think we really need to see some examples of what you data looks like, and what you want your expected result to look like.
Your SQL is attempting to set Body to a single space if string contains "Date Request", perhaps you meant an empty string?
UPDATE Producer_World SET Producer_World.Body = "" WHERE InStr([Body], "Date Request")>0;
I don't allow empty string in fields. I would set to Null.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Your SET statement is setting it equal to a single space, not cutting part of the string out.I want it to delete everything left of "Date Request" in the field "Body"
If you truly just wanted to drop everything before the phrase "Date Request", try this:
Code:UPDATE Producer_World SET Producer_World.Body = Mid([Body],InStr([Body],"Date Request"),Len([Body])) WHERE (((InStr([Body],"Date Request"))>0));
JoeM you da man! That worked! Thanks!
You are welcome.