Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Retrieving SQL Records between dates with Delphi ADO

Avatar of visionetv
visionetvFlag for United States of America asked on
Microsoft SQL ServerDelphiSQL
6 Comments1 Solution1628 ViewsLast Modified:
I have assembled from researching the Web what I thought was the best solution for retrieving records from a SQL 2008/R2 database using two Delphi DateTime pickers. The code is as follows;

InvoiceQuery.SQL.Text :='SELECT SUM(FullPrice)FROM [TransactionEntry] WHERE TransactionTime BETWEEN DatePicker1.Date AND DatePicker2.Date';
InvoiceQuery.Parameters.ParamByName('FromDate').Value := DateOf(DatePicker1.Date);
InvoiceQuery.Parameters.ParamByName('ToDate').Value := DateOf(DatePicker2.Date);
InvoiceQuery.Open;

Running the code I get an EOLexeception message; "Parameter Object is improperly defined. Inconsistent or incomplete information was provided."

I've tried all of the 'Name - Value' combinations I can think of in the Parameters editor for the Delphi ADOQuery component which the same result, any help will be greatly appreciated

Thank you,
Visionetv
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa VukFlag of Croatia imageSoftware architect
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers