cwnonthehill
Member
- Joined
- Nov 5, 2012
- Messages
- 20
- Programming Experience
- 1-3
ok, guys, I have a SQL database with a column called "Date" but with a format of "nchar(8)" so examples of field data are...
12112012
01012013
02022013
etc...
In VB i have a DGV that is databound to this sql table. So, my second column in the DGV is the same as what i have explained above...
With these being Date values, but not of the DateTime data type, i am finding difficulty in Filtering this DGV based on date ranges, as the SQL data coming in is a String Data type...
My question is how can i Filter this DGV for my desired date ranges... An example of what I am needing is...
BUTTON:: to show Last 30 Days of Records
Any assistance is much appreciated!!!
12112012
01012013
02022013
etc...
In VB i have a DGV that is databound to this sql table. So, my second column in the DGV is the same as what i have explained above...
With these being Date values, but not of the DateTime data type, i am finding difficulty in Filtering this DGV based on date ranges, as the SQL data coming in is a String Data type...
My question is how can i Filter this DGV for my desired date ranges... An example of what I am needing is...
BUTTON:: to show Last 30 Days of Records
VB.NET:
Dim last30 as Date
Dim current as Date
last30 = today.date.adddays(-30)
current = today.date
Dim dv as DataView
dv = New DataView(DataSet.Tables("tblName"))
dv.RowFilter = "Date > #" & last30 & "# and Date <= #" & current & "#"
DataGridView1.DataSource = dv
Any assistance is much appreciated!!!