我用C#连接了sqlite数据库,想查询日期字段StadyDate为当天(今天)的记录。
日期最好格式化为类似2000/01/01这种格式
我写代码如下:
string riqi = DateTime.Now.Date.ToString("yyyy/MM/dd");
conn.Open();
string commandText = "select * from pacs_study where StudyDate=riqi order by StudyID desc";
SQLiteDataAdapter sQLiteDataAdapter = new SQLiteDataAdapter(commandText, conn);
运行总提示错误,如下
System.Data.SQLite.SQLiteException:“SQLite error
no such column: riqi”
请问sql查询语句该如何写?