Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries and storing variables 1

Status
Not open for further replies.

Radman

Programmer
Jan 20, 2000
22
AU
Can i stored the results of a select queries into a dynamic array so that later on i can use the array in another select query<br>
<br>
What i am trying to do is write something that is simiular to a stored proceduce.
 
It sounds to me like what you want is a make-table query. In your select query, click on Query in the menu bar and then click on Make Table Query. Enter the name of a table into which you want to store the results of the query. Each time the query is run, it will recreate this table, deleting any existing one with the same name in the process.<br>
If you want to suppress the message that asks whether you really want to delete this table, then remember to set SetWarnings to off before the query in your macro or procedure and then set it back on.
 
If you just want to use results of a query as criteria of the next one, try nested queries. Use SELECT clauses as criterias:<br>
<br>
SELECT Field1, Field2 FROM Table2<br>
WHERE Table2.Field1 IN (SELECT Table1.Field1 FROM Table1 WHERE Field1 LIKE 'Something')<br>
<br>
Be careful with huge data sets. Nesting takes time to run.<br>
<br>
Al
 
I HAVE A QUESTION WITH A QUERY -
I MADE A QUERY TO FORMULATE A WEEK FOR MY DATES : WEEK:(FORMAT([DATE],&quot;ww&quot;)) - THIS RETURNS A WEEK # FOR MY DATES, THIS WORKS OKAY
MY PROBLEM IS, WHEN I GET INTO MY NEXT QUERY I AM GROUPING ON WEEK # (IN ASCENDING ORDER) AND SUMMING A FEW OTHER FIELDS, THIS WORKS OKAY OTHER THAN MY WEEKS IN ORDER ARE SHOWING WEEK 10,11,9 ANY WAY I CHANGE IT THE WEEK 9 IS IN THE MIDDLE NOT THE FIRST RECORD? ANY HELP WOULD BE APPRECIATED. (THOSE ARE THE ONLY 3 WEEKS IN MY QUERY SO FAR)
THANK YOU
 
Hi,

Do you want 9 between 10 and 11???

If you convert your week# to integer then you have much more power to sort it anyway you want.
Week: CInt(YourCurrentFormatFunction)

Al

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top