[ https://issues.apache.org/jira/browse/OFBIZ-5146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227268#comment-14227268 ]
Divesh Dutta commented on OFBIZ-5146: ------------------------------------- Hello Jacopo, After testing your patch for this task, I found that this patch was working fine for mysql and postgres data bases, but this patch was not working for the derby data base. The reason behind that issue is, derby uses different syntax for extracting the Year/Month/Day from Date. Same thing is mentioned by user with user login "wulei.bj...@gmail.com" in user mailing list on mail with subject "GROUP BY month(date)". Consider this example: EXTRACT( 'YEAR' FROM Date) works with postgresql and mysql but not with derby. YEAR(Date) works with derby and mysql, but not with postgresql In this patch file you are using EXTRACT function to get Year/Month/Day from Date so it is not working in derby data base. FYI : If you commit this patch by fixing the derby data base issue then you also need to add these functions (for Year/Month/Day) in http://ofbiz.apache.org/dtds/entitymodel.xsd file. Otherwise these functions will display as errors in entitymodel.xml file, though this will not break any functionality. > in ModelViewEntity.java, a Map is built with only a few of the SQL functions, > extend the map to include the MONTH and Year functions. > ------------------------------------------------------------------------------------------------------------------------------------- > > Key: OFBIZ-5146 > URL: https://issues.apache.org/jira/browse/OFBIZ-5146 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: Trunk > Reporter: Jaideep Singh > Assignee: Jacopo Cappellato > Attachments: ModelViewEntity.patch, ModelViewEntity.patch, > OFBIZ-5146.patch, OFBIZ-5146.patch > > > in ModelViewEntity.java, a Map is built with only a few of the SQL functions, > extend the map to include the MONTH and Year functions. -- This message was sent by Atlassian JIRA (v6.3.4#6332)