sql qUERY用于使用Between运算符显示数据

时间:2015-03-26 14:49:17

标签: mysql

我想在网页上显示来自两个表格的数据,但这个查询没有取第一个文本框的值,即Date1

SELECT Distinct Student.stu_name,
       Attendanc.Stu_id, 
       Attendanc.Date,
       Attendanc.time,
       Attendanc.Status
  FROM Attendanc,
       Student
 WHERE Attendanc.Stu_id = Student.Stu_id 
   AND Student.Email='"+add_email+"' 
   AND Attendanc.Date BETWEEN '" + Date1 + "' AND '"+Date2+"'"

0 个答案:

没有答案