Hello,
On Sonntag, 6. April 2003 16:29, Brian Kavanaugh wrote:
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> [SAP AG][SQLOD32 DLL][SAP DB]General error;-4024.
>
> However, SQL runs fine in SQL Studio. I'm running 7.3.0.29 and the 7.3 ODBC
> driver on Windows 2000. Any suggestions? The dbproc (stripped down to
> minimum fields; parameters aren't used in this section of the dbproc) is
> below:
>
[... Procedure here...]
please excuse me when I'm wrong and also please excuse when my remark is no
direct solution to your question, but to me it appears as if the two queries
that form the union are identical with the exception of the WHERE clause.
So you could probably build just one query and combine the two conditions with
an OR in the where part. I guess it would also run faster than before.
So, the where part should look like this:
WHERE
tblCalendar.isApproved = true AND
((DATE <= tblCalendarDtl.EventDate AND
DATEDIFF( DATE, tblCalendarDtl.EventDate ) < 7
)
OR
(UPPER( tblEventType.EventType ) = 'DEADLINE' AND
DATE <= tblCalendarDtl.EventDate AND
DATEDIFF( DATE, tblCalendarDtl.EventDate ) < 30
))
Peter Willadt