1

The following line of code:

sqldf("UPDATE q1_sql_1 SET MONTH_YEAR = RIGHT(MONTH_YEAR, LEN(MONTH_YEAR) - 4)")

Shows this error:

Error in rsqlite_send_query(conn@ptr, statement) : near "(": syntax error
Blundering Ecologist
  • 1,199
  • 2
  • 14
  • 38
Aneesh
  • 63
  • 2
  • 12

1 Answers1

1

Use length and rightstr. For the functions available in SQLite see:

https://www.sqlite.org/lang_corefunc.html

and for the contributed functions that RSQLite also makes available:

https://github.com/ggrothendieck/sqldf#example-15-use-of-rsqliteextfuns-library-functions

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341