LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Quick help - SQL statement in Excel Macro...


You can use either native Excel QueryTable...
or do it the harder way and code your own ado routine
Which is not so complicated as you might think
(see http://erlandsendata.no)

have you ever used /data /import external data / new db query?

either save the query or create with macro recorder running and edit the
code.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


Florianbur wrote:


Code:
--------------------
Option Explicit
Sub test()
Dim inttest
inttest = 0
Workbooks("efmimuster").Worksheets("Tabelle1").Cel ls(10, 1) =
inttest


End Sub

--------------------


Hi, this is how far I got in Excel :o

Now I would like to implement the following SQL statement:

SELECT Count(tblmain.main_id) AS Anzahlvonmain_id
FROM tblsbu INNER JOIN ((tblarea INNER JOIN tblcinco ON
tblarea.area_id = tblcinco.area_id) INNER JOIN tblmain ON
tblcinco.cinco_id = tblmain.cinco_id) ON tblsbu.sbu_id =
tblcinco.sbu_id GROUP BY tblsbu.sbu, tblarea.area, tblmain.status
HAVING (((tblsbu.sbu)="Electronic Technologies") AND
((tblarea.area)="A-1") AND ((tblmain.status)="EF"));

I think that I basically need to open an Access session, open the
database, run somewhere the sql statement, close it all again. For
that I believe to have to also implement some kind of Access library
in excel.

Never done this before though, maybe I don't have to open an Access
session? I read somewhere I can access tables without opening the
database...

Don't know, could someone pls just show me a standard routine to do
this. Thanks a lot.


---
Message posted from http://www.ExcelForum.com/



 
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
Quick Macro help KJ Excel Discussion (Misc queries) 1 February 28th 08 04:58 PM
Need Quick Macro Help! bxc2739 Excel Discussion (Misc queries) 2 April 24th 06 08:32 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Another Quick Simple VBA question (if...then statement) abxy[_35_] Excel Programming 6 February 27th 04 09:48 AM
Quick VBA code question (if...then statement) abxy[_31_] Excel Programming 4 February 26th 04 01:04 AM


All times are GMT +1. The time now is 12:21 PM.

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

About Us

"It's about Microsoft Excel"