Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Datumkonvertierung + Vergleich

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

hab da ein kleines Problem mit der Konvertierung der Datumsanzeige in SQL. Und zwar soll ich das aktuelle Datum mit dem Datum in ner Tabelle vergleichen, welches ich aber vorher formatieren soll.

Das Ganze sieht ungefähr so aus:

Select...

From ...

Where Sysdate (Format?) from dual >= Datum ;

Mit Sysdate bekommt man doch das aktuelle Datum geliefert oder? Nur, wie konvertiere ich das? :confused:

Genauso mit der Spalte Datum... Mach ich das mit CONVERT? Und wie weiter?

Bitte helft mir! :(

Eine verzweifelte Jusky

ich nehm mal an, dass es sich um eine oracle db handelt.

insofern kannst das format einfach mit to_char(sysdate,'dd.mm.yyyy') umwandeln ...

moegliche formatierungen findest du hier:

http://technet.oracle.com/doc/lite/sqlref/html/squse.htm#1000599

die oracle funktionsuebersicht hier:

http://technet.oracle.com/doc/lite/sqlref/html/sqfun.htm

(eventuell musst du dir nen otn account anlegen. ist, soweit ich weiss frei, d.h. einfach auf otn.oracle.com registrieren .. dann bekommst auch monatliche infos zu schulungen etc. :))

achso, ganz vergessen:

wenn du einen datumsvergleich in der where-clause machen willst, brauchst du to_date() um den wert vergleichen zu koennen.

d.h. entweder:

where sysdate = to_date('01.11.2002','dd.mm.yyyy');

oder:

where to_char(sysdate,'dd.mm.yyyy') = '01.11.2002';

wobei ein character vergleich ein klein wenig langsamer ist, als ein date/number vergleich ...

mfg

Super, danke! - Hat prima geklappt! :)

Eine erleichterte Jusky :D

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.