Replies: 1 comment 5 replies
-
@rcronin First off, what version of HoneySQL are you using? Also, what is
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm using a product called Metabase and working to get a custom driver working. There's a method I'm overriding that constructs logic getting last X weeks. Below is an example of what I'm trying to accomplish
(defmethod sql.qp/date [:db2 :week] [_ _ expr] (hx/- expr (hsql/raw (hsql/format "days" (hsql/call :dayofweek expr)))))
expr
here equates to this:(CAST(current timestamp AS timestamp) + -14 days)
When my code above runs, I get this output:
((CAST(current timestamp AS timestamp) + -14 days) - ? days)
My desired output here is:
((CAST(current timestamp AS timestamp) + -14 days) - dayofweek((CAST(current timestamp AS timestamp) + -14 days)) days)
I'm extremely new to clojure and fumbling my way through this. Any advice or help would be greatly appreciated!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions