By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,127 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,127 IT Pros & Developers. It's quick & easy.

Arrays in Access.

P: n/a
KK
How can I find out the maximum or minimum values out of many values in
an array. I have an array in Access that loads upto 20 values depending
on a sql query. I would like to find out the min and max values from
this array. Is there like a function thats like Max(array()) that can
do that. Please let me know. Thank you
KK

Dec 14 '05 #1
Share this Question
Share on Google+
21 Replies


P: n/a
hmm... I"m a little slow... "based on a SQL query" is the key here.
(Missed that the first 3 times I read it.) If you sort in the query by
the field you want to get the min/max for, the min and max will be at
opposite ends of the recordset.

So if you use (assuming query sorts in ascending order)
rs.MoveFirst
lngMin=rs.Fields("OrderByField")
rs.MoveLast
lngMax=rs.fields("OrderByField")

kinda ugly, but if you pass two variables by Reference, then you can
effectively pass two values out of your function/sub.

Dec 14 '05 #2

P: n/a
KK
Interesting! let me think about this. Thanks for the response.

Dec 14 '05 #3

P: n/a
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

Dec 14 '05 #4

P: n/a
I am not aware of functions like that - too bad.
if you are building the arrays from a recordset sort the recordset
first before you build the array, then you can just get the first and
last values. array(0) and array(ubound(array).

if that is not an option, you are stuck with code. You didn't say
whether or not these were multi dimensional arrays or not - it changes
a little. Try something like this.

Function CreateArray()'this is for testing and to show how the
getminmax fn is used
Dim ary()
ary = Array(8, 6, 7, 5, 3, 0, 9)
MsgBox GetMinMax(ary)
MsgBox GetMinMax(ary, True) 'get max
End Function

Function GetMinMax(ary, Optional bGetMax As Boolean = False)
Dim iCounter
GetMinMax = ary(0) 'set to the first one so it's not empty
For iCounter = 0 To UBound(ary)
If (GetMinMax < ary(iCounter)) Xor bGetMax Then
GetMinMax = ary(iCounter)
End If
Next
End Function

Dec 14 '05 #5

P: n/a
By the way, if this is something you have to do often, looping through
an array is MUCH faster than looping through a recordset.

Dec 14 '05 #6

P: n/a
KK
Good points guys! Thanks.
Sorting before hand actually helped a bit.

Dec 14 '05 #7

P: n/a

"Steve" <th*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

It looks like pietlin has the OP on track by sorting the data. In case that
doesn't work for him, however, I wanted to take exception to this
alternative. Since he only needs the min and max values from the array, he
really doesn't need to sort it. It would be more efficient and easier to
code to simply make a single pass through the array doing comparisons.

psuedocode:

minval = a(lbound)
maxval = a(lbound)
for i = lbound + 1 to ubound
if minval < a(i) then minval = a(i)
if maxval > a(i) then maxval = a(i)
next i

--
Randy Harris
I'm pretty sure I know everything that I can remember.

Dec 14 '05 #8

P: n/a
"Pachydermitis" <pr*******@gmail.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:
By the way, if this is something you have to do often, looping
through an array is MUCH faster than looping through a recordset.


But with a recordset, you wouldn't need to loop it to get the
answer.

Also, my bet is that the speed advantage of an array is going to
decrease the more rows you have.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #9

P: n/a
I may be mistaken, but the Microsoft code behind VB accessing a
recordset still has to loop through the database file's values to find
it's least and greatest. This code is done in some low level language
like C or Assembly so it is very fast. Not to mention you have all the
recodset management overhead that must be done before and after. To
make matters worse, the slowest recordset cursor tyeps are the ones
that support more than forwardonly movement.
An array resides in memory, so there is no file manipulation (unless
windows has wirtten it to a swap file) which is why it is so much
faster. Although you are right about the speed decreasing based on the
size of the array, the speed of accessing a recordset will also
decrease as the size of the recordset increases. I agree with you that
I would never recommend this for huge value lists, but for something
around 20, that he is using very often, it would be quite a bit faster.
Of course even if it's 100 times faster, the user probably won't ever
notice the difference between 1/1000 of second and 1/10 of a second. :)

Dec 15 '05 #10

P: n/a
I thought I would share my humble 2cents worth. Here is a generic query
that will populate an array.

Query1 --- Select * from Table1

populate the array with values from Query1

Sub PopulateArray()
Dim RS As DAO.Recordset, i As Integer
i=0
Set RS = CurrentDB.OpenRecordset("Query1")
'--or Set RS = CurrentDB.OpenRecordset("Select * From Table1")
Do while not RS.EOF
Redim Preserve array1(i)
array(i) = RS(0)
RS.MoveNext
i = i + 1
Loop
RS.Close
End Sub

To find the min and max values you can do this
Set RS = CurrentDB.OpenRecordset("Select Max(fldx) from Table1")

to find the Min value

Set RS = CurrentDB.OpendRecordset("Select Min(fldx) From Table1")

HTH
Rich
*** Sent via Developersdex http://www.developersdex.com ***
Dec 15 '05 #11

P: n/a
If one creates the array from an sql statement one can use joins and
subqueries to have maximum and minimum values appended to each record
and thus to each "row" in our array.
Also we can use GetRows to create the array; we must remember however
that in this two dimensional array the second element refers to the row
or record while the first refers to the field and that the array is
zero based (seemingly regardless of the Option Base setting, that is
a(7,41) refers to the value of the 8th field in the 42 record.

The code below gets all the field values from all the records from
tblCheques, appends a maximum fldAmount field, a minimum fldAmount
field, sorts not by fldAmount but by fldDate and slam dunks the results
into an array named a.

a(7,n) always returns the min amount and a(6,n) returns the max amount.
tblCheques has six fields.

Two subs: one for JET 35 and one for JET 40. 35 should work in 40 as
well, but 40 will not work in 35.

TTBOMK GetRows was a much used method in the X-Base days but is largely
ignored in both DAO and ADO. Too bad, it can be fast and powerful.

Ain't Access grand?

Sub temp40()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MAX(fldAmount) AS maxAmount FROM tblCheques)
x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0) n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Sub temp35()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MAX(fldAmount) AS maxAmount FROM
tblCheques]. x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0]. n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Dec 15 '05 #12

P: n/a
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition
Pick up the maximum and minimum values from the recordset, the use
nextrecordset to get to the recordset used to fil lthe array.

--
Terry Kreft

"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
If one creates the array from an sql statement one can use joins and
subqueries to have maximum and minimum values appended to each record
and thus to each "row" in our array.
Also we can use GetRows to create the array; we must remember however
that in this two dimensional array the second element refers to the row
or record while the first refers to the field and that the array is
zero based (seemingly regardless of the Option Base setting, that is
a(7,41) refers to the value of the 8th field in the 42 record.

The code below gets all the field values from all the records from
tblCheques, appends a maximum fldAmount field, a minimum fldAmount
field, sorts not by fldAmount but by fldDate and slam dunks the results
into an array named a.

a(7,n) always returns the min amount and a(6,n) returns the max amount.
tblCheques has six fields.

Two subs: one for JET 35 and one for JET 40. 35 should work in 40 as
well, but 40 will not work in 35.

TTBOMK GetRows was a much used method in the X-Base days but is largely
ignored in both DAO and ADO. Too bad, it can be fast and powerful.

Ain't Access grand?

Sub temp40()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MAX(fldAmount) AS maxAmount FROM tblCheques)
x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "(SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0) n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Sub temp35()
Dim a As Variant
Dim r As DAO.Recordset
Set r = DBEngine(0)(0).OpenRecordset( _
"SELECT * FROM (tblCheques c" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MAX(fldAmount) AS maxAmount FROM
tblCheques]. x" _
& vbNewLine & "ON c.fldAmount <= x.maxAmount)" _
& vbNewLine & "Left Join" _
& vbNewLine & "[SELECT MIN(fldAmount) AS minAmount FROM tblCheques
WHERE Nz(fldAmount,0) <> 0]. n" _
& vbNewLine & "ON c.fldAmount <= n.minAmount" _
& vbNewLine & "ORDER BY c.fldDate", dbOpenDynaset)
With r
If Not .BOF Then
a = r.GetRows(.RecordCount)
Debug.Print a(.Fields.Count - 1, .RecordCount - 1)
Else
'whatever
End If
End With
Set r = Nothing
End Sub

Dec 15 '05 #13

P: n/a
The real question, Randy, would be "What is the compelling reason for moving
the results of a query into an array?" That is something that a procedural
programmer would do as a matter of course, but not necessarily a good
approach in a database application. It took many of us some time to change
our view from the procedural programming approach to "The Access Way", but
once we get accustomed to "The Access Way", database applications become
much easier.

I can think of several approaches to retrieving the Max and Min... a totals
query, the DMAX and DMIN functions, for example... in addition to the ways
already mentioned. And all a LOT easier than filling and sorting an array
(and likely as fast, or faster, to execute).

Larry Linson
Microsoft Access MVP
"Randy Harris" <ra***@SpamFree.com> wrote in message
news:3R*******************@newssvr14.news.prodigy. com...

"Steve" <th*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
pietlin makes a good point. If you don't order the SQL query, you'll
need to a) sort your array (bubble sort would be efficient, since it's
only 20 elements), or b) write your array to a temporary table and run
a query off of the temporary table (which begs the question of "why
didn't you just sort the original query to start with?")

If your situation is different than I am understanding it to be, can
you show how your array gets its values from the SQL query? I.e., does
the SQL query feed into a form, and your array pick out data from the
form?

It looks like pietlin has the OP on track by sorting the data. In case
that
doesn't work for him, however, I wanted to take exception to this
alternative. Since he only needs the min and max values from the array,
he
really doesn't need to sort it. It would be more efficient and easier to
code to simply make a single pass through the array doing comparisons.

psuedocode:

minval = a(lbound)
maxval = a(lbound)
for i = lbound + 1 to ubound
if minval < a(i) then minval = a(i)
if maxval > a(i) then maxval = a(i)
next i

--
Randy Harris
I'm pretty sure I know everything that I can remember.

Dec 15 '05 #14

P: n/a
"Pachydermitis" <pr*******@gmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
I may be mistaken, but the Microsoft code behind VB accessing a
recordset still has to loop through the database file's values to
find it's least and greatest. . . .
Eh? If you're using a recordset, you'd use GROUP BY and Max() and
Min(), so there wouldn't be an looping needed at all.
. . . This code is done in some low level
language like C or Assembly so it is very fast. Not to mention
you have all the recodset management overhead that must be done
before and after. To make matters worse, the slowest recordset
cursor tyeps are the ones that support more than forwardonly
movement. An array resides in memory, so there is no file
manipulation (unless windows has wirtten it to a swap file) which
is why it is so much faster. Although you are right about the
speed decreasing based on the size of the array, the speed of
accessing a recordset will also decrease as the size of the
recordset increases. I agree with you that I would never
recommend this for huge value lists, but for something around 20,
that he is using very often, it would be quite a bit faster.
SQL aggregate functions will always be faster than looping either a
recordset or an array.
Of course even if it's 100 times faster, the user probably won't
ever notice the difference between 1/1000 of second and 1/10 of a
second. :)


That's not the point. For any process where it's theoretically
possible for the number of items to change, You sould always use
the
most scalable approach, even if right now there is no noticeable
speed increase.

[this is not at all a contradiction of my perennial point that not
all performance optimizations have a real-world effect]

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #15

P: n/a
Rich P <rp*****@aol.com> wrote in
news:Aa**************@news.uswest.net:
To find the min and max values you can do this
Set RS = CurrentDB.OpenRecordset("Select Max(fldx) from Table1")

to find the Min value

Set RS = CurrentDB.OpendRecordset("Select Min(fldx) From Table1")


Er, why not:

Set RS = CurrentDB.OpendRecordset("Select Min(fldx), Max(fldx) From
Table1")

That will get you both values in a single recordset.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #16

P: n/a
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:G-********************@karoo.co.uk:
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition

Pick up the maximum and minimum values from the recordset, the
use nextrecordset to get to the recordset used to fil lthe array.


But why would you need to do that if you're looping the second
recordset to populate an array?

My understanding was that an array was the needed structure here,
and the information about the Min() and Max() values isn't stored
in the array explicitly.

It seems to me that knowing that the array is sorted (and will stay
that way), you always know that the 1st value in it is the Min()
and the last item the Max().

I fail to see how this is problematic, though it assumes that the
array is sorted. As many people have pointed out, if the array is
populated from a SQL resultset, then it is a piece of cake to
retreive it sorted.

So, I can't see what point retrieving the ADO multiple recordset
has in this discussion (though, of course, it's a useful technique
in some cases).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 15 '05 #17

P: n/a
I raised it as a possibility because it is a serious contender to meet the
business requirements and following the recent discussion is topical.

It's a serious contender because
1) If I were populating an array from a recordset I would use the
GetRows method not iterate through the recordset to do so.
2) It may not be convenient to sort the recordset in the sequence
required to find the max value and the min value by the method you're
proposing.

For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the maximum invoice
value, then ordering the recordset by the invoice amount breaks the
requirement.

However

SELECT
MAX(inv_val),
MIN(inv_val)
FROM
invoices
WHERE
cust_code = 'DWF'

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

Fits the requirements.
--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@216.196. 97.142...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:G-********************@karoo.co.uk:
Or if you were using ADO you could do the following

SELECT
MAX(fldVal),
MIN(fldVal)
FROM
MyTable
WHERE
MyField = Condition

SELECT
fldVal
FROM
MyTable
WHERE
MyField = Condition

Pick up the maximum and minimum values from the recordset, the
use nextrecordset to get to the recordset used to fil lthe array.


But why would you need to do that if you're looping the second
recordset to populate an array?

My understanding was that an array was the needed structure here,
and the information about the Min() and Max() values isn't stored
in the array explicitly.

It seems to me that knowing that the array is sorted (and will stay
that way), you always know that the 1st value in it is the Min()
and the last item the Max().

I fail to see how this is problematic, though it assumes that the
array is sorted. As many people have pointed out, if the array is
populated from a SQL resultset, then it is a piece of cake to
retreive it sorted.

So, I can't see what point retrieving the ADO multiple recordset
has in this discussion (though, of course, it's a useful technique
in some cases).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 16 '05 #18

P: n/a
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Fg********************@karoo.co.uk:
For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the
maximum invoice value, then ordering the recordset by the invoice
amount breaks the requirement.


Well, sure, if you change the scope of the original problem, then,
yes, there are any number of other possible answers.

But the original question was about a 1-dimensional array and
finding the Min() and Max() of that array. In that case, an ordered
recordset for populating the array would do just fine.

Your example isn't responsive to that as all, because you're getting
a Min/Max of data other than what is stored in the ordered array.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 16 '05 #19

P: n/a
Hmm, I have so many responses to this post, but I'll restrict myself to the
following.

Specific responses
-----------------------
1) The original post didn't state a 1-dimensional array although it is
implied.
2) The "scope" of the problem was changed way back as soon as people started
talking about ordering the recordset rather than as the OP requested working
with the array.
3) I believe you were the first person to raise Min/Max in this thread which
moved the discussion even further from the OPs question.
4) Changing the scope of the problem is frequently the way you need to go in
order to acheive a more efficient or generic method for dealing with the
problem.
5) If you use the same selection criteria in both select statements then you
are getting the summarised results of the required recordset in the first
statement and the resultset required in the second, without being
constricted by the requirement to fill the array in a sequence necessary to
pick up the Min and Max values.
General response
---------------------
The idea of posting to a newsgroup is not necessarily with the intention of
getting an answer to the specific question asked, by the very nature of
newsgroups a discussion will take place and a number of alternative
solutions will be presented. If a person wants an answer to a specific
question then they are losing out on one of the strongest aspects of posting
to NGs.

--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@127.0.0. 1...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Fg********************@karoo.co.uk:
For example if the requirement was to get the following recordset.

SELECT
cust_name, inv_val
FROM
customers
INNER JOIN
invoices
ON
customers.cust_code = invoices.cust_code
WHERE
cust_code = 'DWF'
ORDER BY
inv_date

but there was also a requirement to find the minimum and the
maximum invoice value, then ordering the recordset by the invoice
amount breaks the requirement.


Well, sure, if you change the scope of the original problem, then,
yes, there are any number of other possible answers.

But the original question was about a 1-dimensional array and
finding the Min() and Max() of that array. In that case, an ordered
recordset for populating the array would do just fine.

Your example isn't responsive to that as all, because you're getting
a Min/Max of data other than what is stored in the ordered array.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 17 '05 #20

P: n/a
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Vx********************@karoo.co.uk:
The idea of posting to a newsgroup is not necessarily with the
intention of getting an answer to the specific question asked, by
the very nature of newsgroups a discussion will take place and a
number of alternative solutions will be presented. If a person
wants an answer to a specific question then they are losing out on
one of the strongest aspects of posting to NGs.


Well, sure, I agree with this. But I think you could have been more
clear about why you were proposing retreiving two recordsets, as in
my head I was still thinking of the ordered 1-dimensional array, and
I'm sure I'm not the only one who was still thinking that way.

It's really a matter of framing: when you're changing the topic,
broadening the discussion or reframing the question, it's best to
say so.

One of the faculty in the Music Department at NYU has a canned
question at all dissertation defenses. It always begins: "So, I know
it's the dissertation you *didn't* write, *but*. . .", and it seems
to me that some kind of preface like that could make the discussion
less confusing.

I think I almost always do that myself when I'm branching out from
the original topic, but perhaps I'm elliptical about it, too.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 17 '05 #21

P: n/a
Oh I don't know, seems that if you read through the thread there's a fairly
logical progression towards my post.

KK - I want the min/max values from an array filed from a recordset
Piet Linden - Order the recordset so the min/max are first/last values on
recordset
Lyle - append min/ max values to records in recordset
TK - use multi-dimensional recordset.

I realise that Piet Linden's message was on a separate branch of the thread
but it still precedes Lyles so the sequence is valid.

Now there were a number of other posts with reasonable suggestions but these
were the ones which stuck in my mind as the progression towards my original
post.
--
Terry Kreft

"David W. Fenton" <XX*******@dfenton.com.invalid> wrote in message
news:Xn**********************************@127.0.0. 1...
"Terry Kreft" <te*********@mps.co.uk> wrote in
news:Vx********************@karoo.co.uk:
Te idea of posting to a newsgroup is not necessarily with the
intention of getting an answer to the specific question asked, by
the very nature of newsgroups a discussion will take place and a
number of alternative solutions will be presented. If a person
wants an answer to a specific question then they are losing out on
one of the strongest aspects of posting to NGs.


Well, sure, I agree with this. But I think you could have been more
clear about why you were proposing retreiving two recordsets, as in
my head I was still thinking of the ordered 1-dimensional array, and
I'm sure I'm not the only one who was still thinking that way.

It's really a matter of framing: when you're changing the topic,
broadening the discussion or reframing the question, it's best to
say so.

One of the faculty in the Music Department at NYU has a canned
question at all dissertation defenses. It always begins: "So, I know
it's the dissertation you *didn't* write, *but*. . .", and it seems
to me that some kind of preface like that could make the discussion
less confusing.

I think I almost always do that myself when I'm branching out from
the original topic, but perhaps I'm elliptical about it, too.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Dec 18 '05 #22

This discussion thread is closed

Replies have been disabled for this discussion.