Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Umstellung auf SQL-Filterung (https://www.delphipraxis.net/181165-umstellung-auf-sql-filterung.html)

mkinzler 21. Jul 2014 15:43

AW: Umstellung auf SQL-Filterung
 
Recht übersichtlich
Zitat:

Zitat von Datumsfunktionen
Function
Description

CURRENT_DATE
Returns the current date

CURRENT_TIME
Returns the current time

CURRENT_TIMESTAMP
Returns the current local date and local time as a timestamp value

NOW
Returns current date and time as a timestamp value

SYSDATE
Returns current date and time as a timestamp value

TOSTRING
Converts date and time to string

TODATE
Converts string to date and time

EXTRACT
Extracts datepart component from datetime value as INTEGER


p80286 21. Jul 2014 16:06

AW: Umstellung auf SQL-Filterung
 
Unter Umständen geht es ja auch so
Zitat:

AND NOW()-RESTELLUNG >= 14
wobei 14 naürlich durch den Timestamp-wert für 14 Tage ersetzt werden muß

Gruß
K-H

Crowbar 21. Jul 2014 16:19

AW: Umstellung auf SQL-Filterung
 
Zitat:

Zitat von p80286 (Beitrag 1266223)
Unter Umständen geht es ja auch so
Zitat:

AND NOW()-RESTELLUNG >= 14
wobei 14 naürlich durch den Timestamp-wert für 14 Tage ersetzt werden muß

Gruß
K-H

Aus irgendeinen Grund benötige ich garkeinen Timestamp-Wert für die "14".
Mit dem SQL-Befehl:
SQL-Code:
SELECT * FROM Buchung WHERE KATEGORIE = "Einnahmen" AND RESTELLUNG is not null AND REEINGANG is null AND (NOW-RESTELLUNG > 14)
klappt nun alles wie gewollt. :)
Vielen Dank an alle ... nun konnte ich wieder mein kleines SQL-Wissen erweitern.


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:15 Uhr.
Seite 2 von 2     12   

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