#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default SQL - array

Is there a way to run a SQL Select on an array in VBA? If I Dim an array like
Dim x(100,100) as integer, can I perform a select statement on it?

Seems like you should be able to since it is like rows and columns from a
spreadsheet and is like a small database.

Thanks!
Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default SQL - array

dave k wrote:
Is there a way to run a SQL Select on an array in VBA? If I Dim an

array like
Dim x(100,100) as integer, can I perform a select statement on it?


No, you cannot query an in-memory array. However, you could write the
array to a worksheet e.g.

Sheet1.Range("A1:CW101").Value = x

then query the workbook e.g.

SELECT F101
FROM
[Excel 8.0;HDR=No;Database=C:\MyWorkbook.xls;].[Sheet1$]
WHERE F1 < 0;

Jamie.

--

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default SQL - array

I was afraid of that, thanks.
Dave


"onedaywhen" wrote:

dave k wrote:
Is there a way to run a SQL Select on an array in VBA? If I Dim an

array like
Dim x(100,100) as integer, can I perform a select statement on it?


No, you cannot query an in-memory array. However, you could write the
array to a worksheet e.g.

Sheet1.Range("A1:CW101").Value = x

then query the workbook e.g.

SELECT F101
FROM
[Excel 8.0;HDR=No;Database=C:\MyWorkbook.xls;].[Sheet1$]
WHERE F1 < 0;

Jamie.

--


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
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Assigning 10x1 array to 2nd collumn of 10x3 array Myrna Larson Excel Programming 0 July 29th 04 11:57 PM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 05:04 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"