IBM Support

Date and time manipulation using the DATE and STRDATE Functions

White Papers


Abstract

The purpose of this paper is to introduce the use of the extended rule syntax for converting Date/Time formatted fields to strings (STRDATE) and string formatted fields to dates and time (DATE). Other topics which will be covered in this paper are the parameters used in the syntax to convert from one format to the other and how to add and subtract from Date/Time formatted fields.

Content

The STRDATE function converts a datetime type into a string using a format that you specify. This function allows you to include static characters such as a slash (/), which gives you access to full date support.

The STRDATE function can be used to:

  • Convert a date/time value to a string to update it to a string column in a database table
  • Convert a date/time value to a string to display the value in a messagebox

Syntax:
STRDATE (datetime,"format", string);
where: datetime= datetime variable/field

format= date format

string= string variable/field

Original Publication Date

26 June 2009

[{"Product":{"code":"SS6UP7","label":"Sterling Gentran:Director"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"5.4;5.3.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SS6V3G","label":"Sterling Gentran:Server for Microsoft Windows"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}},{"Product":{"code":"SS6V5U","label":"Sterling Gentran:Server for UNIX"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg27022716