Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date format variable acts differently

Hi All,

I am facing some challenges with date format.

I have a variable that keeps the max date of a field vMcin  defined as "= max(CI_Date)"

Any time I use this for comparison in expression it works fine

ex. count({$< CI_Date={"$(vMcin)"}>}DISTINCT CENTRE_CODE)

But does not format in text boxes or in the list expression

ex.

=Date($(vMcin),'MM-DD-YYYY')     this gives 12-30-1899 where as 1-02-2016

=if( Status = 'Did not sumbit' and CI_Date = $(vMcin) ,[C Name])

If I use the variable directly in a textbox it displays 0.00024801587301587

Any help will be appreciated!

Thanks in Advance

Aji Paul

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

My mistake ... missing the quotes around the variable

View solution in original post

4 Replies
Anonymous
Not applicable
Author

My mistake ... missing the quotes around the variable

Anonymous
Not applicable
Author

Try like this . It's Working

=Date(vMcin,'MM-DD-YYYY')

Not applicable
Author

the first point is never define a variable like this with '='

define it like max(CI_Date)

Then in the expression u can use count({$< CI_Date={"=$(=vMcin)"}>}DISTINCT CENTRE_CODE)

in text box :

=Date(date#($(=vMcin),'date-format')'MM-DD-YYYY')


here first with dat3 read the format of the date it is in and then convert it to date .



Anonymous
Not applicable
Author

Hi Khushboo,

Thanks for your response

'=' is needed in my case  as I do not want it to get changed. This is NOT a function variable.

The issue was I missed out on quotes around while using the variable.

Thanks,

Aji