Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Issue with OLE DB Query - Date Search
Hi everyone,
I currently have the below code which unfortunately for me means I need to update 2 dates (Last Updated dates). This is changed depending on when I alst ran it. The reason I have this is because it is pulling data back from a database but needs to search in 2 places for this (they have different "TYPE" fields). At the moment I can only get it to bring back data for both by having a date search for both of them also. If I just have one at the end of the queryit searches for ALL CERPS BI and only filters the CERPS by the dates. I'm sure I just need to move some brackets around somewhere but I can't figure it out. Any help is MUCH appreciated 1) TYPE = 'INFORMATION ANALYSIS APP' AND (CATEGORY = 'CERPS BI') 2) TYPE = 'MANUFACT AND SUPPLY CHAIN' AND (CATEGORY = 'BEBOP' OR CATEGORY = 'CERPS' OR CATEGORY = 'ICERPS' OR CATEGORY = 'JCERPS' OR CATEGORY = 'MERPS' OR CATEGORY = 'MERPS2' OR CATEGORY = 'STIEFEL SAP' OR CATEGORY = 'MOD CF') from ARAdmin.GSK_INCIDENT where TYPE = 'INFORMATION ANALYSIS APP' AND (CATEGORY = 'CERPS BI') AND ((TO_DATE(TO_DATE('01/01/1970 00:00:00','MM/DD/YYYY HH24:MI:SS') + ((LAST_UPDATED)/(86400)), 'DD/MM/YYYY HH24:MI:SS')) BETWEEN TO_DATE('13/11/2012 23:59:59','DD/MM/YYYY HH24:MI:SS') AND TO_DATE('14/11/2012 23:59:59','DD/MM/YYYY HH24:MI:SS') ) OR TYPE = 'MANUFACT AND SUPPLY CHAIN' AND (CATEGORY = 'BEBOP' OR CATEGORY = 'CERPS' OR CATEGORY = 'ICERPS' OR CATEGORY = 'JCERPS' OR CATEGORY = 'MERPS' OR CATEGORY = 'MERPS2' OR CATEGORY = 'STIEFEL SAP' OR CATEGORY = 'MOD CF') AND ((TO_DATE(TO_DATE('01/01/1970 00:00:00','MM/DD/YYYY HH24:MI:SS') + ((LAST_UPDATED)/(86400)), 'DD/MM/YYYY HH24:MI:SS')) BETWEEN TO_DATE('13/11/2012 23:59:59','DD/MM/YYYY HH24:MI:SS') AND TO_DATE('14/11/2012 23:59:59','DD/MM/YYYY HH24:MI:SS') ) Also, as a secondary and less important question, can I just have one date? - i.e search for anything last updated since 14/11/12 for example? |
#2
|
|||
|
|||
Anyone? Any help at all or a pointer in the right direction would be so helpful
|
#3
|
|||
|
|||
Could anyone point me in the right direction please? I've been searching for a few days now
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Issue with OLE DB Query - Date Search
Hi
Not sure if you're aware, and it could be why nobody has responded to your question is that this is an Excel Newsgroup. You could try Microsoft.Public.Access.Queries as they are more attuned to OLE DB questions. HTH Mick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XL Query Issue | Excel Programming | |||
Help with search and copy issue | Excel Programming | |||
Search and replace issue | Excel Discussion (Misc queries) | |||
Find date query and Display issue | Excel Worksheet Functions | |||
ms query xp issue | Excel Programming |