*-- return 10 transaccions closest to Jan-15-2005 query_date = {^2005/15/01} select top 10 trans_num, trans_date, (abs(trans_date-query_date)) as ndays ; from trans_table ; order by 3,1or
*-- return transaccions within 3 days from Jan-15-2005 query_date = {^2005/15/01} select trans_num, trans_date ; from trans_table ; where (abs(trans_date-query_date)) <= 3 ; order by 1