Send dates from VB.NET to WHERE
Send dates from VB.NET to WHERE
I^m using Infinity and the OCX controls to run reports. I have a screen in my app where I prompt the user for a string to filter on and a couple of dates (using Calendar controls). I need to send those values to a couple of reports which will run sequentially. Since I struggled but finally succeeded in passing the dates to the WHERE for the OCX control, I thought I^d share a code snippet with anyone interested:____Dim sfirstdate As String = ""____sfirstdate = System.Convert.ToString(Me.FirstDateMonthCalendar1.SelectionRange.Start.ToString("yyyy-MM-dd"))____Dim sEndDate As String = ""__sEndDate = System.Convert.ToString(Me.EndDateMonthCalendar1.SelectionRange.Start.ToString("yyyy-MM-dd"))____Me.RSReport1.Where = "IE_LINK.INSERV_NO=^" settings.InserviceNumber "^" " AND IE_LINK.ATDATE >= {d ^" sfirstdate "^} And IE_LINK.ATDATE <= {d ^" sEndDate "^}"____Me.RSReport1.RunReport(1)