DVar, DVarP Functions (SQL Only)

See AlsovbfctDVarSee                 ExamplevbfctDVarEx>Low


Return estimates of the variance for a population and a population sample represented as a set of values in a specified set of records (domainCQNETL).


DVar( expr, domain [, criteria] )

DVarP( expr, domain [, criteria] )


DVarP evaluates a population, and DVar evaluates a population sample.  The DVar and DVarP functions use the following arguments.

Argument        Description


expr                 String expression1330R89 identifying the field that contains the numeric data you want to evaluate, or an expression that performs calculations using the data in that field.  Operands in expr can include the name of a table field, or a Visual Basic function (which can be intrinsic but not a user-defined function or one of the other domain aggregate or SQL aggregate functions).

domain             String expression identifying the records that constitute the domain.  It can be a table name, a query name, or an SQL expression29F05E5 that returns data.

criteria              Optional string expression used to restrict the range of data on which DVar is performed.  For example, criteria could be the WHERE clause in an SQL expression (without the word WHERE).  If criteria is omitted, DVar evaluates expr against the entire domain.


If the criteria argument contains non-numeric text other than field names, you must enclose the text in single quotation marks.  In the following example from the Orders table of the NWIND.MDB database, Ship Country is the name of a field, and UK is a string literal.

X = DVar("[Freight]", "Orders", "[Ship Country] = 'UK'")

Y = DVarP("[Freight]", "Orders", "[Ship Country] = 'UK'")

Z = DVarP("[Freight]", "Orders", "[Ship Via] = 1")


If domain refers to fewer than two records, or if fewer than two records satisfy criteria, DVar and DVarP return a Null (which indicates that a variance can't be calculated).