-
Notifications
You must be signed in to change notification settings - Fork 107
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
DATEPART not applying in .TDD #505
Comments
Hi Konstantin, It looks like your dialect does not have a base class. You either need to choose a valid base dialect from the list here, or implement every function of the dialect manually, like in our full dialect example. |
@pvanderknyff Thanks for reply! Yes I don't use base class. Could you please tell me the minimal set of functions from full dialect example to make DATEPART work as I need? I just need to understand how it should work))) |
For DATEPART specifically it ends up getting defined twice in the TDD, one with 2 arguments and the other with 3. This is to accommodate a custom start of week (sunday vs monday for example). Here is an example of DATEPART from the Postgres90Dialect: 2 argument DATEPART, common case:
The string values of
3 argument DATEPART, used is custom start of week cases:
Above it appears you only have the 3 argument version defined, which may be part of the issue. With our next release there will be a full dialect (without base class) included with our postgres_odbc and postgres_jdbc examples to provide more concrete examples like this. Thanks, |
About You:
Name: Konstantin
Company: Citymobil
Your question:
I'm trying to customize dialect file and with usual functions like 'YEAR' it works, however when I try to modify date-functions like DATEPART it takes no effect. For example I'm trying to put datetime field to the Text section. Calculation looks like this: "DATEPART('year', [OrderedDate])" and DATEPART is underlined red with this error: "The function 'DATEPART' is not available on non-aggregates for this datasource".
Could you please help me to understand what am I doing wrong?
My TDD looks like this:
The text was updated successfully, but these errors were encountered: