Send dates from VB.NET to WHERE

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
DAVE_I
Posts: 18
Joined: Tue Oct 10, 2017 12:44 pm

Send dates from VB.NET to WHERE

Post by DAVE_I » Tue Oct 02, 2007 7:57 pm

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)

Post Reply