Try cnSql = New SqlConnection(SQL_CONNECTION_STRING) cnSql.Open() strSQL = "SELECT ISNULL(MIN(SH.shipping_start_date), GETDATE()) AS StartDate " strSQL = strSQL + "FROM Shipping AS SH INNER JOIN Working AS WK ON SH.shipping_id = WK.shipping_id " strSQL = strSQL + "WHERE WK.woNo = '" + number + "'" cmSql = New SqlCommand(strSQL, cnSql) readerSQL = cmSql.ExecuteReader() If readerSQL.Read() Then If Not IsDBNull(readerSQL.Item("shipping_start_date")) Then woStartDate = readerSQL.Item("shipping_start_date") End If Else ShipStartDate = DateTime.Now End If readerSQL.Close() cnSql.Close() cmSql.Dispose() cnSql.Dispose() Catch ex As SqlException MsgBox(ex.Message, MsgBoxStyle.Critical, "SQL Error!") Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "General Error!")'error happen here
StartDate
shipping_start_date
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)