Announcement

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

  • Extracting date from clock variable

    I have a date variable called createdon stored as double in %tcnn/dd/ccYY_hh:MM format. How do I create a variable that is just the date?

    The code and error is below.

    gen date_sif = date(createdon)
    invalid syntax
    r(198);

  • #2
    See

    Code:
    help date() 
    
    help dofc()
    to see that date() extracts daily dates from a string argument -- not what you have here -- while dofc() extracts numeric daily dates out of a clock numeric date-time variable.

    Comment


    • #3
      This worked! Thank you

      Comment

      Working...
      X