Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Sometimes a string representation isn't enough. In order to perform certain actions, you need your data to be in a certain format. This recipe will show you how to change that data into a format that you can use.
1. Create a new codeunit from Object Designer.
2. Add the following global variables:
| Name | Type | Length |
|---|---|---|
| DateText | Text | 30 |
| DateValue | Date |
3. Write the following code in the OnRun trigger:
DateText := '01/01/2010';
EVALUATE(DateValue, DateText);
MESSAGE('Date: %1', DateValue);
4. Save and close the codeunit.
5. When you run the codeunit you should see a window similar to the following screenshot: