× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Compare a date to a date?

Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Hoteltravelfundotcom
Sent: Thursday, February 18, 2016 2:00 PM
To: Midrange Systems Technical Discussion
Subject: Re: Why cannot use Current date in this query?

Yes this is almost there. Does it matter that the field is packed numeric?
compare to Current Date is now giving this>

The operands of comparison operator = are not compatible. -- Numeric
operands are compatible with any other numeric operands and with character
and graphic operands. -- Character operands are compatible with operands
that are character, graphic, date, time, timestamp, or numeric. -- Date,
time, and timestamp operands are compatible with character and graphic
operands or with another operand of the same type. -- Graphic operands are
compatible with graphic, character, date, time, timestamp, or numeric
operands. -- Binary operands are compatible only with binary operands. --
Operands that are user-defined types can only be compared to operands that
are the same exact type. -- DataLink operands cannot be compared. Recovery
. . . : Check the data types of all operands to see if the data types
are compatible. If all the operands of the SQL statement are correct and a
view is being accessed, then check the data types of all the operands in the
view definition. Correct the errors. Try the request again.".
Msg 7321, Level 16, State 2, Line 1

On Thu, Feb 18, 2016 at 1:55 PM, <rob@xxxxxxxxx> wrote:

I can do
select columna, columnb, columnc, current date from tableQ

I haven't tested it but you should be able to change this

select * from
...
and CASTAT = ''Y''')

to

select current date, a.* from
...
and CASTAT = ''Y''') a

Look carefully. Both lines were changed.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 02/18/2016 01:37 PM
Subject: Re: Why cannot use Current date in this query?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



So the issue is, you can only show what is being selected, so how to
compare against current date if not in the list? Is there a syntax
needed for Current Date?

On Thu, Feb 18, 2016 at 1:33 PM, Glenn Gundermann <
glenn.gundermann@xxxxxxxxx> wrote:

I don't see CURRENTDATE in your SELECT statement so that leads me to
think
it's being used in openquery().
SQL on the IBM i uses either CURRENT DATE (with a space between) or
CURRENT_DATE.

Do you have the source for openquery() or can you generate the
source
for
it?


Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Work: (416) 675-9200 ext. 89224
Cell: (416) 317-3144


On 18 February 2016 at 13:25, Hoteltravelfundotcom <
hoteltravelfun@xxxxxxxxx
wrote:

HI I would like to use Currentdate but it fails with this message:
OLE DB provider "IBMDA400" for linked server "IBSIBM" returned
message
"SQL0206: Column CURRENTDATE not in specified tables.
Cause . . . . . : CURRENTDATE is not a column of table *N in *N. If
the
table is *N, CURRENTDATE is not a column of any table or view that
can
be
referenced. Recovery . . . : Do one of the following and try the
request
again: -- Ensure that the column and table names are specified
correctly
in
the statement. -- If this is a SELECT statement, ensure that all
the required tables were named in the FROM clause. -- If the
column was intended to be a correlated reference, qualify the
column with the
correct
table designator.".
Msg 7321, Level 16, State 2, Line 1


Possibly the issue is using this IBS tool this openquery?
--------------------------------
select * from openquery(IBSIBM, 'select CABANO, CABCRC, CABCTR,
CABCUR,
CABKCO, CACLVL, CACOTI,
CACRDT, CACTTP, CADODT, CADOTY, CAEXRT, CAIDNO, CAJONO, CANCRX,
CAPERI, CAREFX, CARSCD, CASCRC, CASCTR, CASTAT, CASTMT, CASYID,
CATIML, CATREF, CATTXT, CATYPC, CAUSER, CAVADT, CAVODT, CAVONO,
CAVOTY ,NANAME from CA1665AFCV.SROCBA,
CA1665AFCV.srolta,
CA1665AFCV.sronam
WHERE CADODT > ''20160210'' AND CADOTY = ''CHK'' and cajono=ctjono
and caperi=ctperi and caidno=ctidno and ctveno=nanum and CASTAT =
''Y''')
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.