Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SybaseIQ 12.7: Can not evaluate expression: DATEDIFF(...)

2 posts in General Discussion Last posting was on 2012-05-08 11:46:31.0Z
stbll Posted on 2012-05-04 14:16:37.0Z
Sender: 4bcf.4fa3de07.1804289383@sybase.com
From: stbll
Newsgroups: sybase.public.iq
Subject: SybaseIQ 12.7: Can not evaluate expression: DATEDIFF(...)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fa3e4c4.4cf6.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 4 May 2012 07:16:37 -0700
X-Trace: forums-1-dub 1336140997 172.20.134.41 (4 May 2012 07:16:37 -0700)
X-Original-Trace: 4 May 2012 07:16:37 -0700, 172.20.134.41
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4499
Article PK: 246640

Hi all,
I've the following error executing a select query on
SybaseIQ(IQ Version: Sybase IQ/12.7.0/080215/P/ESD 4).
ERROR: Query 'Internal error at node: #02 Can not evaluate
expression: DATEDIFF(day,BE(4),BE(3))'

Note that checking the query plan at node #2 there is the
following statement:
"...AND DATEDIFF( dd, CONVERT(DATETIME,
CONVERT(VARCHAR(8),TB2.DT_SALEDAY), 112), CONVERT(DATETIME,
CONVERT(VARCHAR(8),TB.DT_SALEDAY), 112) ) between 0 and 6"

The strange thing is that executing the same query on a
different server with the same SybaseIQ version and the same
table structure no exception are throwed.
I've already checked the sysoptions on both servers and they
are the same.

Hereafter there is the error descpition logged in *.iqmsg
file.
I. 05/04 10:04:35. 0000000172
I. 05/04 10:04:35. 0000000172 Exception Thrown from
dfo.cxx:7392, Err# 0, tid 238 origtid 238
I. 05/04 10:04:35. 0000000172 O/S Err#: 0, ErrID: 9216
(df_Exception); SQLCode: -1001043, SQLState: 'QFA39',
Severity: 14
I. 05/04 10:04:35. 0000000172 [20552]: Query 'Internal error
at node: #02 Can not evaluate expression:
DATEDIFF(day,BE(4),BE(3))',
-- (dfo.cxx 7392)

Do you have any idea about this issue?

Best regards,
Stefano


Trevor Moore Posted on 2012-05-08 11:46:31.0Z
Sender: 498d.4fa90698.1804289383@sybase.com
From: Trevor Moore
Newsgroups: sybase.public.iq
Subject: Re: SybaseIQ 12.7: Can not evaluate expression: DATEDIFF(...)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fa90797.49b6.1681692777@sybase.com>
References: <4fa3e4c4.4cf6.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 8 May 2012 04:46:31 -0700
X-Trace: forums-1-dub 1336477591 172.20.134.41 (8 May 2012 04:46:31 -0700)
X-Original-Trace: 8 May 2012 04:46:31 -0700, 172.20.134.41
Lines: 48
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.iq:4500
Article PK: 246639

Hi,

Although I cannot replicate your issue I do have a
suggestion.

If you are using the convert varchar functions to just
obtain a date, you should instead just convert them to a
date to strip the time e.g.:-

"...AND DATEDIFF( dd, CONVERT(DATE,TB2.DT_SALEDAY),
CONVERT(DATE, TB.DT_SALEDAY) ) between 0 and

> Hi all,
> I've the following error executing a select query on
> SybaseIQ(IQ Version: Sybase IQ/12.7.0/080215/P/ESD 4).
> ERROR: Query 'Internal error at node: #02 Can not
> evaluate expression: DATEDIFF(day,BE(4),BE(3))'
>
> Note that checking the query plan at node #2 there is the
> following statement:
> "...AND DATEDIFF( dd, CONVERT(DATETIME,
> CONVERT(VARCHAR(8),TB2.DT_SALEDAY), 112), CONVERT(DATETIME
> , CONVERT(VARCHAR(8),TB.DT_SALEDAY), 112) ) between 0 and
> 6"
>
> The strange thing is that executing the same query on a
> different server with the same SybaseIQ version and the
> same table structure no exception are throwed.
> I've already checked the sysoptions on both servers and
> they are the same.
>
> Hereafter there is the error descpition logged in *.iqmsg
> file.
> I. 05/04 10:04:35. 0000000172
> I. 05/04 10:04:35. 0000000172 Exception Thrown from
> dfo.cxx:7392, Err# 0, tid 238 origtid 238
> I. 05/04 10:04:35. 0000000172 O/S Err#: 0, ErrID: 9216
> (df_Exception); SQLCode: -1001043, SQLState: 'QFA39',
> Severity: 14
> I. 05/04 10:04:35. 0000000172 [20552]: Query 'Internal
> error at node: #02 Can not evaluate expression:
> DATEDIFF(day,BE(4),BE(3))',
> -- (dfo.cxx 7392)
>
> Do you have any idea about this issue?
>
> Best regards,
> Stefano