Question:
How to extract the month and year from excel column?
It is simply to achieve... Your command should looks like:
SELECT Month([Arrival]) As [Month], Year([Arrival]) As [Year], [Arrival]) FROM [Sheet1$]
If you would like to compare month from combobox (and combobox contains numerics form 1 to 12) with arrival date in excel file, your command should looks like:
VB
Dim sSQL as String = String.Empty
sSQL = "SELECT [Arrival]) FROM [Sheet1$] WHERE MONTH([Arrival]) = " & Me.ComboBox1.SelectedValue
Results: all arrival dates which month is equal to
Me.ComboBox1.SelectedValue
C#
String sSQL = String.Empty
sSQL = "SELECT [Arrival]) FROM [Sheet1$] WHERE MONTH([Arrival]) = " + Me.ComboBox1.SelectedValue
Results: all arrival dates which month is equal to
Me.ComboBox1.SelectedValue
Becouse i have no idea, where do you want to present your results, i can't help you more. I recomend you to use
DataGridView[
^] component.