Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

Posted

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

  1. FROM

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...