简体   繁体   中英

Select rows before date in sqlite

How can I with sql select only those rows where date is before a specific date?

I use sqlite3, I manage my database with Django's syncdb , and my date field is created with date = DateField() .

从您的表中选择*,其中date <@date_passed_in

You can do this with IF statement I hope this will help you

IF date < @date_passed_in

THEN Your Select Statement

I would suggest looking at this django reference for detailed understanding. Search for default types for DateField and also DateTime you will get a fair idea.

For DateField, If no input_formats argument is provided, the default input formats are:

['%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y'] # '10/25/06'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM