Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In Formula, Convert date to string data types

Status
Not open for further replies.

kamkaro

Programmer
Oct 25, 2006
23
CA
Hi All,
Please give me your expert suggestions, when I am creating the formula, getting the following error.

Function:
if {?Start_date} = '' then {Command.LAST_MONTH_ST_DT} else {?Start_date}

Error:
A date Time Required Here for {Command.LAST_MONTH_ST_DT} .

Where:
{?Start_date} is String datatype
{Command.LAST_MONTH_ST_DT} is Date datatype

How do I convert Date ({Command.LAST_MONTH_ST_DT})data type to string in formula editor?

Thanks.
 
If the parameter is a string representing a date time date type and is optional

Code:
if hasvalue({?Start_date}) and isdatetime({?Start_date})
then  datetime({?Start_date} )
else {Command.LAST_MONTH_ST_DT}  // assuming the database is returning a date time from the original post
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top