Home > Net >  The great god help me!
The great god help me!

Time:09-17

How to use datediff in SQL statements?

This is my code:
String SQL="select No, Carno Receivingunit, goods, Grossweight, Buckleweight," +
"Netweight, UnitPrice, totalPrice from WeighingRecord where datediff (Day, Entrytime, '" Value + + uiDatetimePicker1."')=0 ".
Entrytime is my time in the database, I want to pick out the database and the choice of control time is the same Day, but complains: System. Data. SQLite. SQLiteException: "SQL logic error no to the column: Day"
This how to solve?

CodePudding user response:

Don't write SQL Entrytime directly between A AND B
A is the value of the date, such as: 2020-01-01 00:00:00
B is date + 1 as 2020-01-02 00:00:00
Solve the speed

CodePudding user response:

Tell me the other, in the aggregate performance worst, use & gt; CodePudding user response:

What day is, without a column
Sqlite different function support and SQL server
  •  Tags:  
  • C#
  • Related