SELECT FIleID, MIRType, MIRSeq, ProcessedOn, PNRCrDate, MIRCrDate, BkgTkgPCC, BkgSignOnTkgSignOn, FIleName, PNR, TicketNumber, [TCN#], PaxType, Passengers, Sector, Airline, FOP, ActualAmt, TotalFare,
BFare, EquivalentFare, NetProfit, Tax1, Tax2, Tax3, Tax4, Tax5, Credit, OrgTicket, SecondEx, ExType, ExFare, ExT1, ExT2, ExT3, ExT4, ExT5, PaxID
FROM qryMIR
WHERE (MIRCrDate BETWEEN #13-Jan-2015# AND #14-Jan-2015#)
I've added a date range query and when executing it works perfectly, since VBA is so different from VB.net i've no clue how to code it in a form. My form has two fields namely, txtFromDate and txtToDate. and my query is like this
VB.NET:SELECT FIleID, MIRType, MIRSeq, ProcessedOn, PNRCrDate, MIRCrDate, BkgTkgPCC, BkgSignOnTkgSignOn, FIleName, PNR, TicketNumber, [TCN#], PaxType, Passengers, Sector, Airline, FOP, ActualAmt, TotalFare, BFare, EquivalentFare, NetProfit, Tax1, Tax2, Tax3, Tax4, Tax5, Credit, OrgTicket, SecondEx, ExType, ExFare, ExT1, ExT2, ExT3, ExT4, ExT5, PaxID FROM qryMIR WHERE (MIRCrDate BETWEEN #13-Jan-2015# AND #14-Jan-2015#)
myTableAdapter.Fill(myDataTable)
myTableAdapter.FillByDateRange(myDataTable, startDate, endDate)
SELECT FIleID, MIRType, MIRSeq, ProcessedOn, PNRCrDate, MIRCrDate, BkgTkgPCC, BkgSignOnTkgSignOn, FIleName, PNR, TicketNumber, [TCN#], PaxType, Passengers, Sector, Airline, FOP, ActualAmt, TotalFare,
BFare, EquivalentFare, NetProfit, Tax1, Tax2, Tax3, Tax4, Tax5, Credit, OrgTicket, SecondEx, ExType, ExFare, ExT1, ExT2, ExT3, ExT4, ExT5, PaxID
FROM qryMIR
WHERE (MIRCrDate = ?) AND (MIRCrDate = ?)
Private Sub btnFetch_Click(sender As Object, e As EventArgs) Handles btnFetch.Click
QryMIRTableAdapter.FillByDateRange(Me.Backup_GAPDataSet.qryMIR, txtFrom.Text, txtTo.Text)
End Sub
WHERE (MIRCrDate = ?) AND (MIRCrDate = ?)
Are you trying to make a query like this?Not sure about vb.net but in vba its like "between forms!frmsearch!Fromdate AND forms!frmsearch!todate thenfrom forms we just call that query.
SELECT FIleID, MIRType, MIRSeq, ProcessedOn, PNRCrDate, MIRCrDate, BkgTkgPCC, BkgSignOnTkgSignOn, FIleName, PNR, TicketNumber, [TCN#], PaxType, Passengers, Sector, Airline, FOP, ActualAmt, TotalFare,
BFare, EquivalentFare, NetProfit, Tax1, Tax2, Tax3, Tax4, Tax5, Credit, OrgTicket, SecondEx, ExType, ExFare, ExT1, ExT2, ExT3, ExT4, ExT5, PaxID
FROM qryMIR
WHERE MIRCrDate BETWEEN ? AND ?
Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
Dim row As DataGridViewRow
row = Me.DataGridView1.Rows(e.RowIndex)
[COLOR=#ff0000]frmReport.ReportViewer1 = ?[/COLOR]
End Sub