Here is the situation:
I have a crystal report in my VB.NET solution that gets generated for a user when they click a certain button. I use a conditional to determine which .fill statement of the reports source tableadapter to use to fill the adapter before the report opens.
In each record for the tableadapter, there is a field called 'ConDispText' which at the start of the string has 2 brackets containing a location code (Ex. [AG] or [1003]). I need to change my .fill statement on the tableadapter to remove or replace the location code ([AG], [1003], or similar) so that it no longer shows up as part of the ConDispText on the crystal report.
After some research it looks like the REPLACE() function is what I'm after, but I cannot figure out how to remove everything between the brackets, not just replace the brackets with empty strings.
What I can do: [AG] The Code Description = AG The Code Description // Replaces the brackets with empty strings
What I need to do: [AG] The Code Description = The Code Description // Removes brackets and everything between.
I cannot just replace say characters 1-4, as some of the codes have 2 characters between brackets, some have up to 5.
Any help would be greatly appreciated as I'm still a pretty low-level novice when it comes to Crystal Reports or SQL.
Thanks!
-A.L.

New Topic/Question
Reply



MultiQuote





|