Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For some odd reason, it was decided to keep the dates found in electronic contracts embedded in the text of the digital contract, found in a text field. Of course, if the contract is in a different language, you gotta code for that as well. 🙂 Better yet, said date follows this format:
<td width="20%">
Application Date:<br/>
Funding Date:<br/>
Due Date: <br/>
</td>
<td>
March 17, 2005 <br/>
March 21, 2005<br/>
April 11, 2005<br/>
</td>
I need to parse out the correct Due Date (in this instance, it's 4/11/2005) somehow.
Tried regular expressions and, as usual, failed to get that engine to do what I want...
select substring(digital_contract_text from '%Due Date:#"(\f|\n|\r| |\t|\v)*\<br\/\>(\f|\n|\r| |\t|\v)*\<\/td\>(\f|\n|\r| |\t|\v)*\<td\>(\f|\n|\r| |\t|\v)*([a-z]| |[A-Z]|,|[0-9])+\<br\/\>(\f|\n|\r| |\t|\v)*([a-z]| |[A-Z]|,|[0-9])+\<br\/\>(\f|\n|\r| |\t|\v)*([a-z]| |[A-Z]|,|[0-9])+#"\<br\/\>%' for '#')
from table_foo
where id = 370
Hilariously, if one moves the initial #" anywhere else than where it is already, the query blows up.
How do I go about parsing that DueDate out of that HTML mess?
Try using function subfield. See attached sample.
Oleg
Try using function subfield. See attached sample.
Oleg
Sweet. Wish SQL had this...
TextBetween() might also be a good approach.
trim(TextBetween(vOriginal, '<br/>', '<', 5));
-Rob