I've got the code below, it gives me an exceptionThe conversion of a char data type to a datetime data type resulted in an out of range datetime value.The error is the same if I used the parameterized query as below or if I concatenate the date into the select statement.The select statement works fine if I run it directly in query analyser in sql.Dim db as New SQLDatabaseDim sql As String = "SELECT vehicleref,manufacturer+' '+model+' '+derivative+' '+ coalesce(additionalfreetext,'') AS Vehicle," sql += "expirydate, mustbeorderedby, mustbedeliveredby FROM vwMatrixDOCReport " sql += " WHERE (convert(datetime,convert(char(10),expirydate,101)) = @sqldate" sql += " OR convert(datetime,convert(char(10),mustbeorderedby,101)) = @sqldate" sql += " OR convert(datetime,convert(char(10),mustbedeliveredby,101)) = @sqldate)" sql += " ORDER BY vehicleref" Dim params As New Collections.Specialized.StringCollection params.Add("@sqldate|" + GetSQLDate()) Try db.openDB() dtDates = db.GetDataSet(sql, params).Tables(0) dgDates.DataSource = dtDates Catch ex As Exception ExceptionHandling.ShowError(ex, "Could not get the information for the report") Finally db.closeDB() End TryPrivate Function GetSQLDate() As String Return "1900-01-01" 'Return Now.Year.ToString + "-" + Now.Month.ToString + "-" + Now.Day.ToString End FunctionPublic Function GetDataSet(ByVal sql As String, ByVal params As Collections.Specialized.StringCollection) As DataSet Try Dim myCmd As SqlCommand = New SqlCommand(sql, conn) For Each s As String In params Dim p() As String = s.Split("|") If Not p(1).ToLower = "dbnull.value" Then myCmd.Parameters.AddWithValue(p(0), p(1)) Else myCmd.Parameters.AddWithValue(p(0), DBNull.Value) End If Next Dim DA As SqlDataAdapter = New SqlDataAdapter DA.MissingSchemaAction = MissingSchemaAction.AddWithKey DA.SelectCommand = myCmd Dim ds As DataSet = New DataSet DA.Fill(ds, "table") Return ds Catch ex As Exception Throw New Exception(ex.Message) End Try End Function