Frequently asked questions - Base
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
How can I select dates within a range?
- Starting with a field holding dates, select entries between a given start and end date.
The query will look like this:
Notes
- In Draft mode the dates have to be in the format DD/MM/YY (the computer will format this as DD/MM/YYYY after validation)
- In SQL mode the dates must be in the format {D 'YYYY-MM-DD'}
SELECT "RéfCommande", "DateCommande" FROM "Commandes" WHERE "DateCommande" BETWEEN {D '2011-05-01' } AND {D '2011-12-31' }
- An alternative technique is to enter two tests against the date field to test the start and end dates separately:
Notes
- It is helpful to make only one of the two date columns visible (by checking the Visible checkbox)
- Use the operators >= and <= respectively for "greater than or equal to " and "less than or equal to"