To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=114299
                 Issue #|114299
                 Summary|Error with some valid queries
               Component|Database access
                 Version|OOO320m12
                Platform|PC
                     URL|
              OS/Version|Windows Vista
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|MySQL Connector/OOo
             Assigned to|dbaneedsconfirm
             Reported by|prune





------- Additional comments from [email protected] Fri Sep  3 20:34:49 +0000 
2010 -------
The following query works on MySQL Workbench but gives an error in
OpenOffice.org Base 3.2 (using the same database, of course):

SELECT address, A.podID, adID, SUM(duration * IFNULL(startDate<='2010-02-24' AND
endDate>='2010-02-24', 0)) 
FROM `cfm`.`adpod_schedule` AS A, `cfm`.`adpod` AS B 
WHERE startDate <= '2010-03-31' AND endDate >= '2010-01-06' AND A.podID=B.podID
GROUP BY adID;

In order to get it to work in Base, I had to replace

SUM(duration * IFNULL(startDate<='2010-02-24' AND endDate>='2010-02-24', 0)) 

with

SUM(duration * IFNULL(startDate <= '2010-02-24', 0) * IFNULL(endDate >=
2010-02-24', 0))

Quite annoying, as you can see.

Interestingly, the IFNULL is colored green instead of blue as it should be,
suggesting this is a parsing issue and there are problems with Base handling
expressions within SUM().

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to