bshaen Posted March 11, 2005 Posted March 11, 2005 i am confuse with "between" query in sql, now i have a form that will display the data retrieve from 3 tables. std and std1 is a global string variable. display = "SELECT s.*, e.* FROM Student s, Exam e, StdExam se WHERE " display = display & "s.StdCode = '" & std & "' BETWEEN " & "s.StdCode = '" & std1 & "' AND " display = display & "se.StdCode = s.StdCode AND se.ExamCode = e.ExamCode" mySqlCommand = New SqlCommand(display, mySqlConnection) myReader = mySqlCommand.ExecuteReader can anyone help me to check what the mistake i made above?? it's cant work purposely in my program. :mad: Quote
Micah Posted March 11, 2005 Posted March 11, 2005 Try this i am confuse with "between" query in sql, now i have a form that will display the data retrieve from 3 tables. std and std1 is a global string variable. display = "SELECT s.*, e.* FROM Student s, Exam e, StdExam se WHERE " display = display & "s.StdCode = '" & std & "' BETWEEN " & "s.StdCode = '" & std1 & "' AND " display = display & "se.StdCode = s.StdCode AND se.ExamCode = e.ExamCode" mySqlCommand = New SqlCommand(display, mySqlConnection) myReader = mySqlCommand.ExecuteReader can anyone help me to check what the mistake i made above?? it's cant work purposely in my program. :mad: The proper format for your query is: SELECT FROM Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.