DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ivan Badia
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Error evaluating {dateExpr}.getHour(),{dateExpr}.getMinute(),{dateExpr}.getSecond() using SQLServer

Created: 08/May/13 06:37 PM   Updated: 15/May/13 09:32 AM   Resolved: 08/May/13 08:49 PM
Component/s: None
Affects Version/s: 3.2.0.release
Fix Version/s: 3.2.2

File Attachments: 1. File datanucleus_sqlserver_datepart.diff (4 kB)

Datastore: Microsoft SQL Server

 Description  « Hide
DateGetHour4Method returns the NumericExpression DATEPART('hh', expr) which is not valid.

The correct expression is DATEPART(hh, expr).

To fix the issue is necessary to add the next line to generate the expression without quotes:


DateGetMinute4Method and DateGetSecond4Method are affected by the same issue.

Thanks in advance.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 08/May/13 07:04 PM
Since you have that datastore then it would be an easy job for you to get the code for the RDBMS plugin and update those methods, test them, and attach a patch here. That's the only way it can work. Awaiting your patch

Ivan Badia added a comment - 08/May/13 07:32 PM
Attached patch with the changes in DateGetHour4Method, DateGetMinute4Method and DateGetSecond4Method

Andy Jefferson added a comment - 08/May/13 08:49 PM
SVN trunk has this now. Thx