Hej jeg har en tabel som indeholder et datotime felt med format 21-10-2014 07:21:18 hvordan laver jeg en sql der finder alle poster der har datoen 30-06-2015
havde forvenetr at dette var ok: select EventTime, count(*) as loading from eventlog where date(EventTime) = #30-06-2015# men det virker ikke
The way date time fields are formatted when you view them is governed by the PC's regional settings. They are always stored in the dB in the same format no matter what regional settings you are using.
Its best to format your dates in SQL statements in US format MM-DD-YYYY or YYYY-MM-DD And as Erik says, include a time interval too.
SELECT EventTime, count(*) as loading from eventlog WHERE EventTime BETWEEN #06-30-2015 00:00# AND #06-30-2015 23:59#
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.