Public Function StringsToSQLBetweenExpression( _ Optional ByVal vFrom As Variant _ , Optional ByVal vThru As Variant _ ) As String
StringsToSQLBetweenExpression("A", "B") = "Between ""A"" And ""B""" StringsToSQLBetweenExpression(Null, "B") = "<= ""B""" StringsToSQLBetweenExpression("A", Null) = ">= ""A""" StringsToSQLBetweenExpression(Null, Null) = "Is Null" StringsToSQLBetweenExpression(12) = ">= ""12""" ' #5See also:
CharactersToSQLInExpression Function IsBetween Function IsWithinPlusOrMinusOf Function RangeComp FunctionvFrom: String value representing the lower bound of the range of values to be located with the SQL WHERE expression. vFrom defaults to Null (which means that it is does not exist, i.e. there is no lower bound) if it is missing or Null or cannot be fixed up to a String.
vThru: String value representing the upper bound of the range of values to be located with the SQL WHERE expression. vThru defaults to Null (which means that it is does not exist, i.e. there is no upper bound) if it is missing or Null or cannot be fixed up to a String.
Note: This function only works with vFrom and vThru values that are strings. If either of these arguments if numeric, they will be fixed up to a String as in example #5.
Note: Embedded double quote characters within either vFrom or vThru will be prefixed by an additional double-quote character so that Microsoft's SQL will not interpret them as the double-quote which ends the string literal.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.