the sql statement to generate the order report