cancel
Showing results for 
Search instead for 
Did you mean: 

ToText() in parameter field

Former Member
0 Kudos

Hi All,

Can toText() be used to convert a date parameter field to string type?

When I use a ToText({?dateRegistered}) in an if case

if ToText({?dateRegistered}) = "" -? throws an error saying a number, date, or date time etc... is needed..

Please guide

thanks for you time.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with your directly

Former Member
0 Kudos

you should be able to run this formula

if ToText({?dateRegistered}) = "" then 0 else 1

did you enter any date value in the parameter? if the parameter value is null then try to select the option "default values for null" option in the formula editor and check the formula

regards,

Raghavendra

Former Member
0 Kudos

my logic is this way:

if toText({?dateRegistered) = "" then

{Command.DateRegistered} = {Command.DateRegistered} else

{Command.DateRegistered} in {?Date Registered})

is shows the error int eh toText

Former Member
0 Kudos

I changed to that option default values... etc still the same error.

Also one more question with time:

Is it possible to enter the time in a time parameter like 1:00 am , right now it only allows

hh:mm:ss which is in the military form.

Thanks for your time.

Former Member
0 Kudos

is your parameter is a date parameter? if so are you trying to run the report with date value =""?

Usually if you create any static date parameter then use default value as 1901-1-1 and try this fromula

if {?date parameter}=date("1/1/1901") then

true

else

{date field}={?date parameter}

Are you using date range parameter with start date and end date?

regards,

Raghavendra

Former Member
0 Kudos

yes i am using date range but there no start and end date mentioned.

and my parameter is static.

Former Member
0 Kudos

Got it. If you are not using start date and end date then you might be using multi value parameter. If you are using multi value parameter you need to mention the index value of each item like an array. for example

if totext({?date parameter} [1]) = "" then true

else

in {?date parameter}

this example checks the first value is "" or not

regards,

raghavendra

Former Member
0 Kudos

I tired this way to check with multiple values,it says that a string variable is needed when the check to "" is performed.

my dateParameter is of Date data type.

Also i just have the range value=true in the parameter property.