LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VB macro code for SQL Query

Hello,

I am an experienced Excel user just starting to build VB
code/scripts. I'm trying to put a SQL query (from an ODBC
data source) into a macro, so that when it runs, it
returns the result set to a specified range in a worksheet
(i.e. Sheet2!A1).

The query is something like:

Select serialnum, count(serialnum)
from TicketGrids
where serialnum like sheet1!a2

and other queries are very complex involving inner joins,
full outer joins and views from the SQL database.

I am trying to automate a complex report where data is
currently manually imported.

Thanks in advance!

Dan
 
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
another macro query - deleting a worksheet within a query DavidHawes Excel Discussion (Misc queries) 2 February 26th 07 10:05 AM
Code To Refresh Query Table Carl Excel Discussion (Misc queries) 0 December 8th 06 01:23 AM
VB Code for MS Query Gustavo[_4_] Excel Programming 3 June 25th 04 08:57 PM
Code Query JohnUK Excel Programming 4 June 2nd 04 09:40 PM
query source code Mel[_7_] Excel Programming 1 August 29th 03 11:24 PM


All times are GMT +1. The time now is 01:45 AM.

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"