Can anyone provide the code for adding the MS Access replace() function to the prm files, I’m going to try and guess at the code but rather someone could provide a copy if they have it working!
I have tried a few variations but cannot get the function to work.
This is as far as I have reached and i still get unrecognised function when parsing. I’ve tried as syntax {fn replace($1,$2,$3)} but this did not work either.
Whether the code is in the .PRM file or not has nothing to do with whether it will parse or not. Parsing is strictly a database operation. You can use any function available - as long as you have the proper syntax. But it has to be a database function, not a VBA function. If you can’t do the select directly in MS Access, then it won’t work from Designer, even if you do put it into the parameter file.
Many thanks for that - now this is where I am confused as I can use the replace function in MS Access. However I cannot use the same code in designer it just doesn’t work. As far as I know Replace() is not a VBA function it is a built in MS Access Function that can be called up in the query panel.
The error I consistently get is “undefined function”.
For instance for a given field “Name” in table “Names” if I wish to replace the letter R with D in the string “Rave” in MS Access I use the syntax
Name: Replace([Names]![Name],"R","D")
However if I use this code in Designer against the same DB, It won’t parse and it won’t run in webi (XI R3)
I don’t know if anyone knows the answer perhaps replace is not a DB function?
Replace certainly appears to be a VB function based on what I found via Google. The fact that it’s not working in SQL would be a second indication. On the other hand, I did find one article that showed a sample with SQL code.
Needless to say, I can say with confidence that it’s not the lack of the syntax in the .PRM file that’s keeping it from working.
Many thanks again for your reply. The example given in the query panel in MS Access on the link you posted is exactly the same syntax I have used. Therefore as the Replace() function appears to be an MS Access function could the issue lie with the MS Access ODBC driver not being able to perform the translation?