Skip to main content

Posts

Showing posts from June, 2009

Using XPath to display only the current Year

Using XPath to display only the current Year 1. Right click your textbox and select properties. 2. For Data Types select Text (string). 3. Select the formula button next to the Value box in the Default Value section . 4. Select Insert Function. 5. Select substring-before (in the Text functions). 6. For the first field, put in the field with the date your want or the function today() for today's date. 7. After the comma, put in "-" 8. Your final formula should look like this: substring-before(today(), "-") The substring-before function takes all the characters in the first string (today() in our case) up to the first occurrence of the character in the second string (the hyphen, for us). Since today() returns a date formatted as: "2008-07-16", taking everything before the first hyphen returns the year.