I'm a bit new to Access and need help setting up a report based on a query.
I have a table with the following fields
Some of the DocumentNumber data is strictly numeric, some have a prefix "F"
What I want to do is the following:
For each unique date, extract the lowest and highest DocumentNumber and calculate a total of the SaleAmount fields which have that same date,but which do not have the prefix "F".
For each date extract all the individual records which have the prefix "F"
The end result would be a table with all records ordered by date showing:
For the non-prefixed doc numbers, one record for each date:
For each docnumber prefixed "F", each record (could be several with the same date):
I'm supposing I need to set up a query using SQL and then, from that query produce my report. What I'm having most trouble with right now is the SQL statements to set up the query.
Can some one give me an idea of how to write the SQL for the query?
I have a table with the following fields
- Date
- DocumentNumber
- Client
- ClientIDNo
- SaleAmount
Some of the DocumentNumber data is strictly numeric, some have a prefix "F"
What I want to do is the following:
For each unique date, extract the lowest and highest DocumentNumber and calculate a total of the SaleAmount fields which have that same date,but which do not have the prefix "F".
For each date extract all the individual records which have the prefix "F"
The end result would be a table with all records ordered by date showing:
For the non-prefixed doc numbers, one record for each date:
Date, From(Low unprefixed doc number), To(High unprefixed doc number), Client, ClientIDNo, Total (SaleAmount for the Date)
For each docnumber prefixed "F", each record (could be several with the same date):
Date, prefixed doc number, Blank Field, Client, ClientIDNo, SaleAmount from that record
I'm supposing I need to set up a query using SQL and then, from that query produce my report. What I'm having most trouble with right now is the SQL statements to set up the query.
Can some one give me an idea of how to write the SQL for the query?