|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO.NET Rowfilter - between 2 datesDear VB experts,
how can i set a rowfilter to a Dataview that filters the data from a startdate to a enddate? I tried this, but whithout success: Me.CurDataViewStatistik.RowFilter = "DATEFIELD >= #" & Format(Me.dtpVon.Value, "yyyy\/MM\/dd") & "# AND DATEFIELD <= #" & Format(Me.dtpBis.Value, "yyyy\/MM\/dd") & "#" The execution shows no errors, but the rowcount is 0. Database is Access 2003 with .NET 2.0. Thank you Steffen The following works fine for me:
mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #11/01/2006# AND EMP_HireDate < #11/30/2006#" As does: Dim d1 As Date = #11/1/2006# Dim d2 As Date = #11/30/2006# mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #" & d1.Date.ToString & "# AND EMP_HireDate < #" & d2.Date.ToString & "#" HTH <steffen.trom***@gmail.com> wrote in message Show quoteHide quote news:1164100695.233477.188990@j44g2000cwa.googlegroups.com... > Dear VB experts, > > how can i set a rowfilter to a Dataview that filters the data from a > startdate to a enddate? > > I tried this, but whithout success: > > Me.CurDataViewStatistik.RowFilter = "DATEFIELD >= #" & > Format(Me.dtpVon.Value, "yyyy\/MM\/dd") & "# AND DATEFIELD <= #" & > Format(Me.dtpBis.Value, "yyyy\/MM\/dd") & "#" > > The execution shows no errors, but the rowcount is 0. > > Database is Access 2003 with .NET 2.0. > > Thank you > Steffen > John is correct.
I would further qualify your statement by including times as well. StartDate = '11/01/2006 00:00:00' EndDate = '11/30/2006 59:59:99' If you don't then, depending on the type of DateTime construct, you may miss some records. T. Show quoteHide quote "Prester John" <presterj***@comcast.net> wrote in message news:l-OdnRS_VvB0OfLYnZ2dnUVZ_tWdnZ2d@comcast.com... > The following works fine for me: > > mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #11/01/2006# AND > EMP_HireDate < #11/30/2006#" > As does: > > Dim d1 As Date = #11/1/2006# > > Dim d2 As Date = #11/30/2006# > > mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #" & d1.Date.ToString & > "# AND EMP_HireDate < #" & d2.Date.ToString & "#" > > HTH > > > > <steffen.trom***@gmail.com> wrote in message > news:1164100695.233477.188990@j44g2000cwa.googlegroups.com... >> Dear VB experts, >> >> how can i set a rowfilter to a Dataview that filters the data from a >> startdate to a enddate? >> >> I tried this, but whithout success: >> >> Me.CurDataViewStatistik.RowFilter = "DATEFIELD >= #" & >> Format(Me.dtpVon.Value, "yyyy\/MM\/dd") & "# AND DATEFIELD <= #" & >> Format(Me.dtpBis.Value, "yyyy\/MM\/dd") & "#" >> >> The execution shows no errors, but the rowcount is 0. >> >> Database is Access 2003 with .NET 2.0. >> >> Thank you >> Steffen >> > > Although he might want to use
EndDate = '11/30/2006 23:59:59" instead of 59:59:99. Robin -------------------------------------- Show quoteHide quote "Thunder" <jo***@atlanticrdc.com> wrote in message news:O4LIliZFHHA.5104@TK2MSFTNGP03.phx.gbl... > John is correct. > I would further qualify your statement by including times as well. > > StartDate = '11/01/2006 00:00:00' > EndDate = '11/30/2006 59:59:99' > > If you don't then, depending on the type of DateTime construct, you may > miss some records. > > T. > > "Prester John" <presterj***@comcast.net> wrote in message > news:l-OdnRS_VvB0OfLYnZ2dnUVZ_tWdnZ2d@comcast.com... >> The following works fine for me: >> >> mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #11/01/2006# AND >> EMP_HireDate < #11/30/2006#" >> As does: >> >> Dim d1 As Date = #11/1/2006# >> >> Dim d2 As Date = #11/30/2006# >> >> mEmployeeAO.MainView.RowFilter = "EMP_Hiredate > #" & d1.Date.ToString >> & "# AND EMP_HireDate < #" & d2.Date.ToString & "#" >> >> HTH >> >> >> >> <steffen.trom***@gmail.com> wrote in message >> news:1164100695.233477.188990@j44g2000cwa.googlegroups.com... >>> Dear VB experts, >>> >>> how can i set a rowfilter to a Dataview that filters the data from a >>> startdate to a enddate? >>> >>> I tried this, but whithout success: >>> >>> Me.CurDataViewStatistik.RowFilter = "DATEFIELD >= #" & >>> Format(Me.dtpVon.Value, "yyyy\/MM\/dd") & "# AND DATEFIELD <= #" & >>> Format(Me.dtpBis.Value, "yyyy\/MM\/dd") & "#" >>> >>> The execution shows no errors, but the rowcount is 0. >>> >>> Database is Access 2003 with .NET 2.0. >>> >>> Thank you >>> Steffen >>> >> >> > >
Visual Basic to be discontinued in 2008??
Saving the Color value into a string How do I even start debugging this. User Interface Design - Books? Need for Speed Trouble displaying info from access db 2 dimensional array question programmatically allow tcp/ip to msde Radio buttons - best practice ClickOnce program fails to run properly after update |
|||||||||||||||||||||||