Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default SQL ODBC MSQuery in EXCEL

I have an excel spreadsheet and want to import data from ODBC oracle table.
I had to write the SQL code because the query could not be shown
graphically...
and it does work successfully. The problem is that I want to include
criteria in the WHERE clause for BRICKDATE, but cannot get it to work...

SELECT AC_WC_DEMOG_CRSTAB.BRICKDATE, AC_WC_DEMOG_CRSTAB.STATE,
Sum(AC_WC_DEMOG_CRSTAB."DEC1-3_RECORD_COUNT") AS "DEC1-3_RECORD_COUNT
FROM (AC_WC_DEMOG_CRSTAB)
WHERE (AC_WC_DEMOG_CRSTAB.STATE='NY')
GROUP BY AC_WC_DEMOG_CRSTAB.BRICKDATE, AC_WC_DEMOG_CRSTAB.STATE

I have tried this code but does not work...
WHERE (AC_WC_DEMOG_CRSTAB.STATE='NY') AND
(AC_WC_DEMOG_CRSTAB.BRICKDATE='2008-06-01 00:00:00'))

the date that is used is the actual date in the field that was copy/pasted in.
I need the SQL code that will work in MSQuery from exel to ODBC table.
Thanks
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to run a MSQuery from Excel as a Scheduled Task Doug Excel Discussion (Misc queries) 1 March 6th 09 06:01 PM
msquery in Excel 2007 Philippe Cand Excel Discussion (Misc queries) 1 June 22nd 06 03:06 AM
msquery odbc -- excel repeats query on return [email protected] Excel Discussion (Misc queries) 0 April 3rd 06 06:22 PM
Multiple ODBC Database lik in one MSQUERY query Alain79 Excel Discussion (Misc queries) 0 September 13th 05 12:25 PM
excel 2000, vba and msquery(sql) pmz Excel Programming 1 October 29th 03 02:23 PM


All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"