C_BOWI_40 · Question #142
Which two statements describe reasons for using the FormatDate() function?
The correct answer is B. You want to convert a date object into a string object. C. You want to format a date so that it is displayed as a string when it is concatenated with another. FormatDate() converts a date object into a formatted string, making it necessary when displaying dates in custom formats or concatenating dates with other strings.
Question
Which two statements describe reasons for using the FormatDate() function?
Options
- AYou want to convert a string object into a date object.
- BYou want to convert a date object into a string object.
- CYou want to format a date so that it is displayed as a string when it is concatenated with another
- DYou want to modify the format of a string object into a non-standard date format.
How the community answered
(51 responses)- A8% (4)
- B88% (45)
- D4% (2)
Why each option
FormatDate() converts a date object into a formatted string, making it necessary when displaying dates in custom formats or concatenating dates with other strings.
Converting a string into a date object is accomplished with the ToDate() function, which is the inverse operation; FormatDate() only converts from date to string.
FormatDate() takes a date object and a format pattern as arguments and returns the date as a string object, enabling developers to control exactly how a date value is displayed to the end user.
Web Intelligence requires both operands of a string concatenation to be string types; FormatDate() is used to convert the date object into a string so it can be joined with other string values without a data type error.
FormatDate() operates exclusively on date objects, not string objects; reformatting a string representation of a date would require first converting it to a date object with ToDate().
Concept tested: FormatDate() function - date to string conversion
Source: https://help.sap.com/viewer/ad62de02-ba29-44fb-88c3-2cb1a7f5c659/4.2/en-US
Topics
Community Discussion
No community discussion yet for this question.