Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract DateTime from Memo
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01393970
Message ID:
01393985
Views:
54
very good! thanks

>I would use regular expressions
>
>PUBLIC loList
>LOCAL loRegExp AS "VBScript.RegExp"
>lcText = "some text entered with date time field 04/09/2009 11:18:26 AM and then some more text 04/10/2009 02:45:00 PM whatever."
>loRegExp = CreateObject("VBScript.RegExp")
>loRegExp.Global = .T.
>loRegExp.Pattern =  "(\d{2}/\d{2}/\d{4} \d{2}:\d{2}:\d{2} (AM|PM))"
>loList = loRegExp.Execute(lcText)
>*? loList.Count
>FOR i=1 TO loList.Count
>	? loList.Item(i-1).Value
>ENDFOR
>
>
>>I have a table with memo field where a datetime can be entered at various points in the field
>>
>>How can i extract this datetime?
>>
>>example for {04/09/2009 11:18:26 AM}
>>
>>
some text entered with date time field 04/09/2009 11:18:26 AM and then some more text

>>
>>and i need to extract the "04/09/2009 11:18:26 AM" or what ever datetime is present
>>thanks in advance
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform