vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Mails senden, abrufen und decodieren - ganz easy ;-)  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Hmmm  
Autor: ModeratorDieter (Moderator)
Datum: 12.02.02 15:52

Hallo XTray,

aber das steht doch auch im Tipp:
<code><font color=#000099>Dim</font> SQL <font color=#000099>As</font> <font _
  color=#000099>String</font>
<font color=#000099>Dim</font> sDatumVon <font color=#000099>As</font> Date
Sim sDatumBis <font color=#000099>As</font> Date
 
<font color=green>' Zeitraum (z.B. Februar 2002)</font>
txtVon.Text = "01.02.2002"
txtBis.Text = "28.02.2002"
 
<font color=green>' Alle Termine eines bestimmten Zeitraums ermitteln</font>
sDatumVon = <font color=#000099>CDate</font>(txtVon.Text)
sDatumBis = <font color=#000099>CDate</font>(txtBis.Text)
 
<font color=green>' SQL-Anweisung</font>
SQL = "SELECT * FROM Termine WHERE Datum BETWEEN #" & _
  Format$(sDatumVon, "m-d-yy") & "# AND #" & _
  Format$(sDatumBis, "m-d-yy") & "#"
-yy# AND #m-d-yy#</code>
Und nach einem bestimmten Jahr lässt sich demzufolge so suchen:
<code><font color=#000099>Dim</font> SQL <font color=#000099>As</font> <font _
  color=#000099>String</font>
<font color=#000099>Dim</font> sDatumVon <font color=#000099>As</font> Date
Sim sDatumBis <font color=#000099>As</font> Date
 
<font color=green>' Zeitraum (z.B. 2002)</font>
txtVon.Text = "01.01.2002"
txtBis.Text = "31.12.2002"
 
<font color=green>' Alle Termine eines bestimmten Zeitraums ermitteln</font>
sDatumVon = <font color=#000099>CDate</font>(txtVon.Text)
sDatumBis = <font color=#000099>CDate</font>(txtBis.Text)
 
<font color=green>' SQL-Anweisung</font>
SQL = "SELECT * FROM Termine WHERE Datum BETWEEN #" & _
  Format$(sDatumVon, "m-d-yy") & "# AND #" & _
  Format$(sDatumBis, "m-d-yy") & "#"
-yy# AND #m-d-yy#</code>
Cu
Dieter
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Datum in Access Datenbank abfragen73Xtray12.02.02 14:54
Re: Datum in Access Datenbank abfragen548ModeratorDieter12.02.02 15:17
Re: Datum in Access Datenbank abfragen38Xtray12.02.02 15:31
Re: Datum in Access Datenbank abfragen39Xtray12.02.02 15:31
Hmmm 528ModeratorDieter12.02.02 15:52
Re: Hmmm 40Xtray12.02.02 15:54
Re: Hmmm 517unbekannt12.02.02 16:03
Re: Hmmm 562ModeratorDieter12.02.02 16:07

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel