NOT NULL
NOT NULL

Reputation: 13

How to store a date in SQLite?

How do I store on a table a value date using the format 'yyyy -mm- dd' ? because SQLITE does not have a specific type to store this kind of value ?

Example of use:

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

Upvotes: 0

Views: 59

Answers (1)

Larry Lustig
Larry Lustig

Reputation: 50970

To store:

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

To retrieve:

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

Upvotes: 1

Related Questions