Potentially useless anecdote: When I was studying for my Bachelor's, I took a class called Programming Languages (later to be replaced by compilers). The subject of study was an obscure multi-paradigm language called Oz (with it's equally obscure IDE, Mozart).
For one of the last assignments, I had to write a Fibonacci function. Being that the Fibonacci series reuses its values, I wrote a function that stored values in a dictionary. Then, instead of a long painful O(n^2) wait, Fibonacci(500) was done in milli-(micro?)seconds.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...