|
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 tothink
it's being used in openquery().for
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
it?the
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
betable is *N, CURRENTDATE is not a column of any table or view that
can
correctlyreferenced. Recovery . . . : Do one of the following and try therequest
again: -- Ensure that the column and table names are specified
inCABCUR,
the statement. -- If this is a SELECT statement, ensure that allcorrect
the required tables were named in the FROM clause. -- If the
column was intended to be a correlated reference, qualify the
column with the
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,
listCABKCO, CACLVL, CACOTI,list
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
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
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 mailing list archive is Copyright 1997-2025 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.