I am trying to use dbplyr and the trunc function from pl/sql, to mutate the date column to the start of the month.
df %>% mutate(start_month = sql(trunc(date_column, 'month'))
however this throws an error invalid identifier when executing the query. I think it is because when it is parsed to pl/sql as a string the query reads select .... trunc("date_column",'month') as start_month
so it doesn't recognise as a column name due to the quotes inside the sql function.... Any ideas on how to do this another way or get around this error would be great.