SELECT语句包括拼写错误或缺失的保留字或参数名称,或标点符号不正确。 [英] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
问题描述
private void button3_Click(object sender,EventArgs e)
{
DateTime vdateFrom = GC.getDueDateFrom();
DateTime vdateTo = GC.getDueDateTo();
string getAllData =选择P_Id,P_Password,格式(Treat_Due_Date,\dd / MM / yyyy \)作为DueDate,P_Name,P_City,medicineTaker,来自patient_Details ,Treatment_Details where patient_Details.P_ID = Treatment_Details.Treat_P_ID AND Treat_Due_Date>#+ vdateFrom.ToString(dd / MM / yyyy)+#AND Treat_Due_Date<#+ vdateTo.ToString(dd / MM / yyyy )+#;
bindGrid(getAllData);
}
private void button3_Click(object sender, EventArgs e)
{
DateTime vdateFrom = GC.getDueDateFrom();
DateTime vdateTo = GC.getDueDateTo();
string getAllData = "Select P_Id,P_Password,Format(Treat_Due_Date,\"dd/MM/yyyy\") As DueDate,P_Name,P_City,medicineTaker, from patient_Details,Treatment_Details Where patient_Details.P_ID = Treatment_Details.Treat_P_ID AND Treat_Due_Date > #" + vdateFrom.ToString("dd/MM/yyyy") + "# AND Treat_Due_Date < #" + vdateTo.ToString("dd/MM/yyyy") + "#";
bindGrid(getAllData);
}
推荐答案
试试选择P_Id,P_Password,格式(Treat_Due_Date,\'dd / MM / yyyy'\)
这篇关于SELECT语句包括拼写错误或缺失的保留字或参数名称,或标点符号不正确。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!