jlopeman
IS-IT--Management
- Apr 25, 2011
- 35
Good morning,
Using Crystal XI and MS SQL 2008R2 database, I'm trying to parse a string that's basically a condition stored in the database. Here's and example of the format of the string:
{dbTable.dbField}="some medication name" & {dbTable.dbField}="some medication strength" & {dbTable.dbField ="some boolean condition"
I've created a formula to parse out the medication name, which is what I want the results to be:
WhilePrintingRecords;
Mid({string}, InStr({string},'"'), Instr({string},'"'))
This kind of works for the first medication listed, but the formula seems to be cutting off the med. names that are longer, or returning too much of the string.
I need to capture whatever is inside of the first set of quotes, regardless of the length of that substring. Then, I'll need to go back and capture whatever is in the second set of quotes for another formula to capture the Rx strength.
Thanks in advance,
Jason
Using Crystal XI and MS SQL 2008R2 database, I'm trying to parse a string that's basically a condition stored in the database. Here's and example of the format of the string:
{dbTable.dbField}="some medication name" & {dbTable.dbField}="some medication strength" & {dbTable.dbField ="some boolean condition"
I've created a formula to parse out the medication name, which is what I want the results to be:
WhilePrintingRecords;
Mid({string}, InStr({string},'"'), Instr({string},'"'))
This kind of works for the first medication listed, but the formula seems to be cutting off the med. names that are longer, or returning too much of the string.
I need to capture whatever is inside of the first set of quotes, regardless of the length of that substring. Then, I'll need to go back and capture whatever is in the second set of quotes for another formula to capture the Rx strength.
Thanks in advance,
Jason