I am trying to extract the date from a field based on a pattern - If the first four characters of the field description are *SLD then I need to extract the date from the field description as output date else I need to take the date from the field orddate as the the output date..please find the table below:
| description | orddate | output Date |
|---|---|---|
| *SLD 5/18/22 Rimel | 5/2/2022 | 5/18/2022 |
| SOLD mila | 5/3/2022 | 5/3/2022 |
| *SLD 5/23/22 345671 kilo | 5/15/2022 | 5/23/2022 |
| *SLD 5/14/22 jing ming | 5/1/2022 | 5/14/2022 |
| 123566 | 5/12/2022 | 5/12/2022 |
I would do something like: