when i'm use single text box for date it work fine but when a'm check between two dates it gives error
this is my code
Dim adp As New SqlDataAdapter("select EmplID='" + TextBox1.SelectedValue + "', date between ='" & TextBox2.Text & "' and '" & TextBox3.Text & "' ,RESULT = CASE WHEN exists(select * from AtdRecord where RecDate between ='" & TextBox2.Text & "' and '" & TextBox3.Text & "' and EmplID='" + TextBox1.SelectedValue + "') THEN ('P')ELSE ('A ' ) END,ResultType= CASE WHEN exists (select * from AtdRecLeave where StDate between = '" + TextBox2.Text & "'and '" & TextBox3.Text & "' and EmplID='" + TextBox1.SelectedValue + "') THEN (SELECT ResultType FROM AtdRecLeave WHERE EmplID='" + TextBox1.SelectedValue + "' and stDate between = '" + TextBox2.Text & "' and '" & TextBox3.Text & "') else ('-') END", con)
eror=
Incorrect syntax near the keyword 'between'.
Incorrect syntax near '='.
Incorrect syntax near '='.
Incorrect syntax near '='.