Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB2 Pass-Through query question

Status
Not open for further replies.

krymat

Technical User
Jul 25, 2000
105
I need to extract the last 90 days worth of data from a DB2 database. I have ODBC drivers setup already and I can link in and get the data with a select query but it takes a long time. I was hoping a Access 2k Pass-Through query would speed it up, but I'm having problems with the SQL. I can get the following to work:

Select A.PO_NUM,A.PO_LVL,A.CHNG_LOG_DATE_1,A.DETL_STAT_CODE,A.ITEM_CODE,A.ITEM_DESC,A.ITEM_PACK,A.ITEM_SIZE,A.CURR_LST,A.TOT_CASES_PRCHSD,A.TOT_CASES_RCVD,A.BOL_DIFF_IN_CASES,B.VPTR_NUM,B.ITEMIZ_DIV,B.WHSE_NUM,B.DUE_DTE,B.RECV_END_DTE,B.PO_NUM AS PO_NUMBER,B.PO_LEVEL,B.INVC_AMT_RECV from #ISCPIP.KPOD_T A,#ISCPIP.KPOH_T B where A.PO_NUM = B.PO_NUM AND A.PO_LVL = B.PO_LEVEL AND A.CHNG_LOG_DATE_1 >= '8/18/2001' and A.CHNG_LOG_DATE_1 <= '11/16/2001'

How would I get the Last 90 days worth?

Something like >=Now() and <=Now()-90?
 
xmad,
This may sound dumb, but are your date formats set up right? ie, in my experience w/db2, I've seen many, if not most dates set up as char(8) in format 'yyyymmdd'.
If it's a timestamp field, I think that's a char(26) or something but it translates to date/time in odbc for access.
--zjim
 
I don't administer or have any access to the database other than through ODBC so I don't know. Perhaps it is a view of some kind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top