Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Welches Datums- und Zeitformat in SQLite? (https://www.delphipraxis.net/91953-welches-datums-und-zeitformat-sqlite.html)

phreax 12. Mai 2007 11:17

Datenbank: SQLite • Version: 3.2.2 • Zugriff über: Wrapper TSQLiteDatabase

Welches Datums- und Zeitformat in SQLite?
 
Hallo Zusammen,
Meine Frage ist, in welchem Format erwartet SQLite Zeit und Datum?
SQLite nimmt ja alles an deshalb funktioniert natürlich
SQL-Code:
CREATE TABLE Table1 ( Datum DATE , Zeit TIME );
INSERT INTO Table1 (Datum,Zeit) VALUES('01.01.2007','02:00');
aber wenn ich mehrere Werte drin habe und dann Abfragen à la
SQL-Code:
SELECT * FROM Table1 WHERE Datum>'01.01.2003';
Dann bringt er halt auch Daten von 1993 weil er das ganz wohl als String erkennt und nicht als Datum, bei Zeiten genauso.

denn SQLite versucht ja umzuwandeln und fügt nur bei Fehlschlagen der umwandlung den String ein.
Zitat:

Zitat von SQLite FAQ
So, for example, if a column is of type INTEGER and you try to insert a string into that column, SQLite will attempt to convert the string into an integer. If it can, it inserts the integer instead. If not, it inserts the string.

Danke für alle Antworten im voraus

phreax

PS: Ich nutze diesen Wrapper, was aber für dei Frage stellung eigntlich nicht relevant ist.

EDIT: besserer Titel.


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz