Results 1 to 1 of 1

Thread: [RESOLVED] an sql ststement

  1. #1

    Thread Starter
    Fanatic Member d2005's Avatar
    Join Date
    Aug 2005
    Location
    ireland
    Posts
    620

    Resolved [RESOLVED] an sql ststement

    hi im trying to write an sql statement with a few constraints

    VB Code:
    1. Dim cmdselect1 As SqlCommand
    2.         cmdselect1 = New SqlCommand("select c_msg from tb_msg_log ", oSQLConn)
    3.         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:
    1. Dim cmdselect1 As SqlCommand
    2.         cmdselect1 = New SqlCommand("select c_msg from tb_msg_log where c_msg_dir = 'I' order by c_msg_time desc ", oSQLConn)
    3.         txtMsgText.Text = cmdselect1.ExecuteScalar().ToString()
    4.         oSQLConn.Close()
    Last edited by d2005; Sep 22nd, 2005 at 05:46 AM.
    it works 60% of the time, all the time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width