View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
scos00 scos00 is offline
external usenet poster
 
Posts: 1
Default Pull data with entered date


Hi,

I was grappling with this problem for quite a while and have (finally)
come up with a solution so hopefully this will help you.

The problem (I believe) is that the database is Oracle, whose internal
date format is (usually) 'DD-MON-YY'. No matter how I tried to pass
the date through a parameter box in MS Query it failed with an Oracle
error code.
I have not found a way round this using MS Query but I have found a way
round it if you build the query in VBA.

I just started recording a macro and opened a query in MS Query and
then passed it back to Excel. When you examine the Macro code you can
see where you need to edit the SQL.

Add the parameter value as a "?" (as suggested in this thread I think).
Then when you try and run the Macro Excel will prompt you for the
value. It should work if you enter a valid Oracle format date, e.g.
01-OCT-05.
I've linked this to a cell where the format is "text" so that it
doesn't try and convert it to an Excel date.

HTH.


--
scos00
------------------------------------------------------------------------
scos00's Profile: http://www.excelforum.com/member.php...o&userid=28264
View this thread: http://www.excelforum.com/showthread...hreadid=479472