For calculations with dates, you have to convert the stored value into a
date first. CommCare stores dates as strings that cannot be used for
calculations. So your expression would be:
int ( today() - date(/data/loaded_date) )
Best,
Devika
Field Manager, Dimagi
Skype: d_devika
+91 9555571141
···
On Wed, Jul 2, 2014 at 3:44 PM, Eric Stephan wrote:
Hi all... here is a serious newbie question for you all --
I have the following expression in a label:
Days since last visit:
I'm kind of wishing it would say something like 5 (if the number of days
between the two were five) ...
for your info, "loaded date" is loaded into the form by means of case
management...
and also, when I make label fields to simply display the contents of those
two date fields, for debugging, they both display fine!
I'm sure it's just a thing about how you work with date expressions...
any thoughts?
Aha... I knew it would be something like that. Big thanks for
your help. I will have to touch base with the reference
materials again. THANKS --Eric
···
On Wed, Jul 2, 2014, at 05:29 PM, Devika . wrote:
Hi Eric,
For calculations with dates, you have to convert the stored
value into a date first. CommCare stores dates as strings that
cannot be used for calculations. So your expression would be:
int ( today() - date(/data/loaded_date) )
Best,
Devika
Field Manager, Dimagi
Skype: d_devika
+91 9555571141
On Wed, Jul 2, 2014 at 3:44 PM, Eric Stephan <[1]estephan500@gmail.com> wrote:
Hi all... here is a serious newbie question for you all --
I have the following expression in a label:
Days since last visit:
I'm kind of wishing it would say something like 5 (if the
number of days between the two were five) ...
for your info, "loaded date" is loaded into the form by means
of case management...
and also, when I make label fields to simply display the
contents of those two date fields, for debugging, they both
display fine!
I'm sure it's just a thing about how you work with date
expressions... any thoughts?
thanks
eric
--
You received this message because you are subscribed to the
Google Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to
[2]commcare-users+unsubscribe@googlegroups.com.