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.

SQL - Kalenderwoche

Empfohlene Antworten

Veröffentlicht

Hallo,

Ist es möglich mittels SQL ALLE Daten einer Kalenderwoche zu erhalten?

Also dass ich zum Beispiel für die Kalenderwoche 1 in 2012 „2.1.-8.1.2012“ und den „31.12.2012“ zurückbekomme?

Danke für eure Hilfe,

Sarene

where datum between Anfangsdatum and enddatum

aber über einen direkten SQL Befehl ist mir nichts bekannt.

oder du legst dir ne extra Tabelle an, in der steht welche Tage zu welcher KW gehören.

  • Autor

? Ich möchte genau die Daten ermitteln, die in einer bestimmten KW liegen, da kann ich nicht extra ne Tabelle für anlegen. ;)

Anfangs- und Enddatum sind mir unbekannt.

Ich hab nur die Kalenderwoche+Jahr. Mehr Infos habe ich nicht.

Schau dir mal die Datumsfunktionen deines DBMS an. Für MSSQL gibt es unter anderem die DATEPART Funktion. Bsp. für KW des aktuellen Datums:

SELECT DATEPART(wk, GETDATE())

Ein Artikel bei StackOverflow geht in die Richtung.

Google - Suche nach "sql get dates from week number" bringt dich sicherlich auf die Richtige Fährte.

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.