filter()
on boolean/legal variables only works with 1 and 0
#1116
Labels
filter()
on boolean/legal variables only works with 1 and 0
#1116
I have a table with a boolean/legal column. I used
filter(my_lgl_column == TRUE)
and this throws an error as follows:Error: nanodbc/nanodbc.cpp:1655: 42000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'TRUE'. [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Statement(s) could not be prepared.
I found that changing the filter to 1's and 0's corrects this issue:
filter(my_lgl_column == 1)
Although both would work with a local dataframe as well, would be good if dbplyr could convert TRUE/FALSE to 1/0 in the query script.
I'm working with SQL Server and odbc connection.
The text was updated successfully, but these errors were encountered: