hi im trying to write an sql statement with a few constraints
VB Code:
Dim cmdselect1 As SqlCommand cmdselect1 = New SqlCommand("select c_msg from tb_msg_log ", oSQLConn) txtMsgText.Text = cmdselect1.ExecuteScalar().ToString()
need this to say
where c_msg_time = most recent ( date time field)
and c_msg_dir = I
any help much appreicated
HERES HOW ITS DONE
VB Code:
Dim cmdselect1 As SqlCommand cmdselect1 = New SqlCommand("select c_msg from tb_msg_log where c_msg_dir = 'I' order by c_msg_time desc ", oSQLConn) txtMsgText.Text = cmdselect1.ExecuteScalar().ToString() oSQLConn.Close()


Reply With Quote