Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting integer %td to float %td

    Hello,

    Is there any way I can convert a date variable stored as an integer and displayed as %td to storage type "float" %td and vice versa?

    Any help is much appreciated!

  • #2
    Code:
    help recast
    In most circumstances,

    Code:
    help compress
    is a more useful idea. What is your specific reason for wanting this?

    Comment


    • #3
      Thank you, Mr Nick. It worked. But it did not help with my ultimate intention. I was trying to merge two datasets. In the first dataset, the date variable is displayed as 1-Jan-20, 1-Feb-20 ... In the second dataset, the date variable is displayed as 01jan2020, 01feb2020 ... And the merge using dates is unsuccessful even after converting to int %td. Is there any way around this?

      Any help is much appreciated!

      Comment


      • #4
        you are not really providing sufficient info - it sounds as though the date variable in one is a string while it is in Stata internal format in the other (and thus is numeric); you don't even show the error message you received; nor do you explain what you mean by "unsuccessful" (it's possible my guess above is wrong); so, please read and follow the advice in the FAQ, esp. section 12

        Comment

        Working...
        X