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?
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?