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.

CSV-Tabelle mit Datumswerten nach MySQL exportieren

Empfohlene Antworten

Hallo,

ich hab leider gerade ein dickes Brett vor dem Kopf beim Thema Datumsumwandlung - vielleicht kann mir jemand mal ein wenig auf die Sprünge helfen?!

Und zwar geht es darum, daß aus einer Datenbankabfrage eine CSV-Datei generiert wird, in der Datumswerte im Format TT.MM.JJJJ (also z.B. 15.11.2005) gespeichert sind. Diese Datei würde ich gerne möglichst ohne besondere weitere Bearbeitung in eine MySQL-Tabelle einlesen. Dort ist aber das Standardformat für Datumsangaben bekanntermaßen YYYY-MM-DD. Kann mir nun jemand einen Tip geben, wie ich den Upload trotzdem am einfachsten geregelt bekomme, ohne Formatierungen jedes Mal manuell vornehmen zu müssen? Vielleicht weiß sogar jemand, wo ich ein fertiges Skript herbekomme, daß das erledigt?

Danke für Eure Hilfe,

Grüße,

-etops-

Hi,

du könntest das Datum in eine char Spalte einlesen und dann nachträglich über einen Update ins richtige Format in die richtige Spalte umkopieren.

UPDATE tabelle

SET datum = CONCAT('-', RIGHT(temp_datum, 4), MID(temp_datum, 4, 2),

LEFT(temp_datum, 2));

Gruß Jaraz

Superklasse, danke, das paßt und ist mir 'ne große Hilfe!!!

:uli :marine

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.