on 11-13-2011 3:23 PM
I've written following formula in Display String of a field, the field has value Name or Date dynamically.
if IsDate(CurrentFieldValue) then
ToText(CDate(CurrentFieldValue), "dd MMM yyyy")
else
CStr(CurrentFieldValue)
Following is the error I get only when field gets date value
Error in formula <Display_String>.
'if IsDate(CurrentFieldValue) then
'
A string is required here.
In the 1st branch, the field is already a date, so remove the CDate() logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for you attention.
Without CDate() like this it shows following design time error and if I save it forcibly the same error at run time.
Too many arguments have been given to this function.
if IsDate(CurrentFieldValue) then
ToText(CurrentFieldValue, "dd MMM yyyy")
else
CurrentFieldValue
I already tried different things but couldn't get rid of this problem.
If I try constant values just for testing it works, means problem is in returning value not condition.
if IsDate(CurrentFieldValue) then
"Date"
else
"No"
I even tried following without if and it works perfect but only for Date DB values obviously.
ToText(CDate(CurrentFieldValue), "dd MMM yyyy")
Please help me to get rid of this error, thanks in advance.
Thanks again for your support.
I used exactly what you mentioned and I get following design time error on saving formula and it highlights the formatting parameter i.e.
"dd MMM yyyy"
.
Too many arguments have been given to this function.
and if do it with little modification as following
if IsDateTime(CurrentFieldValue) then
(
ToText(CDate(CurrentFieldValue), "dd MMM yyyy")
)
else
ToText(CurrentFieldValue)
it saves but at run time on DB date value it shows following error
A string is required here
Please help me out, thanks in advance.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.