>Hi. I'm accessing a Btrieve database via ODBC, i need to run a sql command for selecting a group of records.. Do i have to select all the table's records and then run my query? This is the only way it seems to work... > >sql_command = "select Stock_Code, Warehouse_Number, Orig__Batch_ID, sum(val(Qty)) as howmany from SC0100_Stck_Transact WHERE Stock_Code='16081LQA106' group by Stock_Code, Warehouse_Number, Orig__Batch_ID order by Stock_Code, Warehouse_Number, Orig__Batch_ID" > >sqlexec(gnConnHandle,sql_command, "SC0100_Stck_Transact") >>Other question did the BTrieve has the function VAL()?