Question : Visual Basic : MS Access : Parameter for Query

.
I am having trouble sending an All Inclusive Paramter

HOW can I send an All Inclusive Parameter ?


----- the query has two Paramters :   ACode  +   NCode
they are used to Filter the results

Some cases the sNCode parameter will equal a Specific string
Works great of course

Problem : Some cases I want to set the NCode parameter to include ALL things
--basically not have a filter at all
-- tried sending as a parameter :
*   returns nothing
<> 0 returns nothing

.
sNCodeis set as a String

cmd.CommandText = "SELECT * FROM qryOutput_HD_MT"
Set rst = cmd.Execute(Parameters:=Array(sACode, sNCode))
.
.

Answer : Visual Basic : MS Access : Parameter for Query

Try it and tell me if it works.

MIN(Result) will take the minimum of the results.

18,2000            1      Negative      27,0000            04/06/2010
21,0000            1      Positive       9,0000            04/06/2010
14,0000            1      Same            14,0000            04/06/2010

Sorted alphabetically, the Min of (Negative, Postive and Same) is "Negative".

16,5000            2      Same            16,5000            05/06/2010
31,0000            2      Positive      20,0000            05/06/2010
21,0000            2      Same            21,0000            05/06/2010

Sorted alphabetically, the Min of (Positive and Same) is "Positive".


It will work.
Random Solutions  
 
programming4us programming4us