-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function translations for DATEDIFF and DATEADD #1080
Comments
dbplyr doesn't know the column types, so it is not possible to simply translate @hadley What's your opinion on this? |
What about translating the R function Is it possible/recommended for me to extend dbplyr function translation and add |
Yeah, I can't see an easy way for dbplyr to support this currently — we don't know the column types so we can't make |
I'm going to reopen as we explore the possibility of implementing translations for the clock functions. I've opened an initial PR here. Thanks for your help with this. |
Feature Request
DATEDIFF and DATEADD are commonly used SQL functions with slightly different syntax on different database platforms. I would like to use dbplyr's translation approach to generate SQL statements DATEDIFF and DATEADD that are correct for various database platforms.
I can use sql passthrough but then the dplyr code won't be translated and work on multiple database platforms. I would like to write one dplyr expression to calculate the difference between dates (or addition of an interval to a date) that will be translated correctly on both sql server and postgres. Below is a reprex that generates correct SQL on postgres but not sql server.
Created on 2022-12-15 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: