generating report based on values in 2textboxes
-
i had generated a report from a query in access (ie using the query as a datasource), and that worked fine. However, now i want to run the report based on the query in the database and 2 values (ie between 2 dates) in textboxes so i have hardcoded the following SQL statement behind the command button to generate the report. However, i do not know what to do from here - the SQL statement will be a datasource and datamember for what - the data environment? the command? the report? Thanking you! SELECT DISTINCT Client.Company, OrderGenerate.OrderNumber, Sum(OrderDetail.Price) AS SumOfPrice FROM (Client INNER JOIN OrderGenerate ON Client.ClientCode=OrderGenerate.ClientCode) INNER JOIN OrderDetail ON OrderGenerate.OrderNumber=OrderDetail.OrderNo WHERE Date Between ' " & txtDateFrom.Text & "' and ' " & txtDateTo.Text & "' GROUP BY Client.Company, OrderGenerate.OrderNumber