How to find data from date to date and ID

I am working on my company's ledger and my accounts department need a search ledger by COA id with from date to date.

I am able to find the record from date to date but when I write the code for COA ID, then it ignore the date formula.

Below is my complete code that I tried

 {ledgerdetails.date} in {?datef}to{?dateto}

       and 
       {ledgerdetails.Accountnamedr} = {?tran} or 
      {ledgerdetails.accountnamecr}={?tran} 

I also tried

{ledgerdetails.date} >= {?datef}

         and

        {ledgerdetails.date} <= {?dateto}

For the backend, I'm using vb.net and MS SQL.

how to search and autofill datagrid using 1st column

dear all

i have a invoice table

now in that datagrid table i have 4 columns

itemcode itemdescription qty price

now what i need is

user come to itemcode and whenever he type itemcode, he should get a list of initial alphabetic itemnames like if i type A so itemcode must show all items codes related to A

and when i get my required itemcode, after pressing enter it should fill the related field (item description,qty,price)

please guide with codes

thanks