Highlighted

Date changed to default value when returned from IIF function

Explorer ,
Sep 24, 2014

Copy link to clipboard

Copied

Hi,

can anyone please explain why the vDate is being displayed as a decimal number in the following code. It seems that the IIF() functions returns  some default value and not what I set

Thanks.

<cfset vNow = DateFormat(Now(), "mm/dd/yyyy")>

<cfoutput>

  vNow = #vNow# <br />

</cfoutput>

<cfset vDate = iif(true,  vNow, "")>

<cfoutput>

  vDate = #vDate# <br />

  Formatted vDate = #DateFormat(vDate,"mm/dd/yyyy")# #TimeFormat(vDate, "hh:mm:ss")#

</cfoutput>

nevermind. I had to apply Evalue(DE()) to the IIF paramater as follows and it is working:

<cfset vDate = iif(true,  Evaluate(DE("vNow")), "")>

Views

140

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Date changed to default value when returned from IIF function

Explorer ,
Sep 24, 2014

Copy link to clipboard

Copied

Hi,

can anyone please explain why the vDate is being displayed as a decimal number in the following code. It seems that the IIF() functions returns  some default value and not what I set

Thanks.

<cfset vNow = DateFormat(Now(), "mm/dd/yyyy")>

<cfoutput>

  vNow = #vNow# <br />

</cfoutput>

<cfset vDate = iif(true,  vNow, "")>

<cfoutput>

  vDate = #vDate# <br />

  Formatted vDate = #DateFormat(vDate,"mm/dd/yyyy")# #TimeFormat(vDate, "hh:mm:ss")#

</cfoutput>

nevermind. I had to apply Evalue(DE()) to the IIF paramater as follows and it is working:

<cfset vDate = iif(true,  Evaluate(DE("vNow")), "")>

Views

141

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 24, 2014 0
Explorer ,
Sep 24, 2014

Copy link to clipboard

Copied

nevermind. I had to apply Evalue(DE()) to the IIF paramater as follows and it is working:

<cfset vDate = iif(true,  Evaluate(DE("vNow")), "")>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 24, 2014 0