• hi Mike,

    you try to do it the wrong way. You should not try to modify your SQL-Code from outside. You can define input parameters in SQL-Procedures too.

    ALTER PROCEDURE dbo.DateRange

    @inFromDate datetime,

    @inToDate datetime

    as

    set nocount on;

    SELECT FirstName, LastName, DateofBirth

    FROM Table1

    WHERE DateofBirth BETWEEN @inFromDate AND @inToDate

    ORDER BY DateofBirth

    RETURN

    Know you just have to find out how to pass over the date values from Visual Basic to the procedure. As this is nothing unusual you should find your way trough.