Hi Dave
I think this is what you need
where you have written
where (20000000 + OHDTET) < todaysDate;
replace that with
where (20000000 + OHDTET) < :todaysDate;
Note the colon (:) in fron t of todaysdate
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
"Dave Petrosky"
<Dave.Petrosky@ma
ines.net> To
Sent by: <rpg400-l@xxxxxxxxxxxx>
rpg400-l-bounces@ cc
midrange.com
Subject
Imbedded SQL and Date
03/25/2010 02:37
PM
Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>
Searched this archive and all over the web (actually reached the guy at
the end and he beat me)
I have this code:
dtodaysDate s 8 0
todaysDate = %dec(%date());
Exec SQL Create Alias QTEMP/OrderHeaderRemote for OHORDHP(REMOTE);
Exec SQL Insert Into WRKBATRMT(workFile, workMember,
workCMPN, workDIVN, workDPTN, workCUSN, workORNR)
Select 'OHORDHP', 'REMOTE', ohcmpn, ohdivn, ohdptn,
ohcusn, ohornr
from QTEMP/OrderHeaderRemote
where (20000000 + OHDTET) < todaysDate;
This returns no rows. If I take this code to interactive SQL and
substitute:
20100325 for todaysDate, the code works fine.
I have tried making todaysDate as packed, tried casting (20000000 +
OHDTET) and todaysDate as date, as char(8) first then as date. I have
some hair left, so please help me out.
David M. Petrosky
Programmer/Analyst
Maines Paper & Food Service, Inc.
101 Broome Corporate Parkway
Conklin, NY 13748
(office) 607-251-7378
dave.petrosky@xxxxxxxxxx
www.maines.net <
http://www.maines.net/>
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.