如何在SQLite中存储日期?

时间:2015-11-06 03:05:00

标签: database sqlite datetime

如何使用格式'yyyy -mm- dd'在表格上存储值日期?因为SQLITE没有特定的类型来存储这种值?

使用示例:

SELECT * FROM MySimpleTable
WHERE DeliveryDate between '1/11/2015' AND '6/11/2015'

1 个答案:

答案 0 :(得分:1)

存储:

 INSERT INTO YourSimpleTable (DeliveryDate) VALUES ('2015-01-11')
 INSERT INTO YourSimpleTable (DeliveryDate) VALUES ('2015-06-11')

要检索:

 SELECT * FROM YourSimpleTable WHERE DeliveryDate BETWEEN '2015-01-11' AND '2015-06-11'