Unable to save a specific date into a date (float %d) variable:

18 views
Skip to first unread message

Vivek Astvansh

unread,
Sep 3, 2015, 3:53:59 PM9/3/15
to Stata Users Forum
Hello, Helpers.

I am failing to store a date into a date (float %d) variable. Details below:

>replace confirm_d=date("12/04/2002","MDY") if casenum=="01-39371"
(0 real changes made)

>desc confirm_d
float %d

> desc casenum
str8 %9s

Can anyone please guide me on what is wrong in the replace statement?

Thank you.

J

unread,
Sep 3, 2015, 4:11:18 PM9/3/15
to Stata Users Forum
check your 'if' condition. It is not even trying to update any values. This suggests that your if condition is never true.

Ramadhani Abdul

unread,
Nov 12, 2015, 10:09:51 AM11/12/15
to Stata Users Forum

 The message you get "0 real changes made" suggest that  there is no casenum with the value 01-39371.
Reply all
Reply to author
Forward
0 new messages