Announcement

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

  • Using today's date as a constant in an if qualifier

    I'm trying to draw up some graphs that show a time range up until the present day + 31 days ahead using the following:
    Code:
    if(date >= 21975 & date <= ((date(c(current_date),"DMY")) + 31 ) ), ///
    The code works if I replace "((date(c(current_date),"DMY")) + 31 )" with what it corresponds to (22709) - but if I try it in my twoway line plot it just gives me:

    Code:
    unexpected end of file
    r(612);
    I don't know how to proceed from here...

  • #2
    I'd go

    Code:
    local now = daily(c(current_date), "DMY")
    and then refer to `now' in your graph call.

    Comment

    Working...
    X