![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
write a query to pull the fields you need for the form, and including the date-of-sale field. set criteria on the date-of-sale field as Between Forms!MyFormName!StartDateControl And Forms!MyFormName!EndDateControl the expression should be all on one line, regardless of linewrap in this post. replace MyFormName with the correct name of the form, and replace StartDateControl with the correct name of the control where you enter the beginning date of the date range, and ditto EndDate control for the ending date of the range. still in query Design view, choose Query | Parameters from the menu bar, and in the dialog box enter the two parameters, as each on separate lines, as Forms!MyFormName!StartDateControl Forms!MyFormName!EndDateControl with the corrected form and control names, of course, and assign Date/Time data type to each. last, turn the query into a Totals query by clicking the toolbar button that looks like a fancy capital E, or a capital M turned on its' side. Group By the salepersonID field (that's the default grouping assignment), and Count another field - that will be the total number of records in the query, grouped by each salespersonID. if you have a field showing dollar value of each sale, Sum that field, for total sales value. use the query as the form's RecordSource. hth joecosmi... (AT) gmail (DOT) com> wrote in message news:05b24761-ba59-4efd-a1f2-d44b80f1dfb1 (AT) b16g2000yqb (DOT) googlegroups.com...http://mail.avatel.us/1.jpghttp://ma...vatel.us/3.jpg I have provided links to 3 pictures which will hopefully help you understand what I’m trying to do. I need to be able to have a form that has each sales person’s name with a total number of sales for the given date fields that I enter. Since the form is in Continuous Forms mode, you can see that it lists all of the sale’s people who made sales between the dates I specified at the top. If you look at 2.jpg, you will see that I filtered the form to show only Evelyn’s sales but there are a bunch. I’m trying to get this form to show Evelyn only once (or any other user I filter) and then the number of sales he/she had. I want to be able to show all sales people as well but only show their names once and then the total number of sales they did between the dates I chose. Each sale’s person has their own unique ID and comes from a table called SalesEmployeeT. The table that contains the sales is called LeadDetailT. Every time someone creates a sale, it creates a single LeadDetail ID in that table, so one sale means one new ID created. There are fields in that LeadDetailT that reflect the total amount of sales and total amount of maintenance called TotalSales and TotalMaint. I use a simple formula to add both fields for a grand total. Thanks in advance. |
#4
| |||
| |||
|
|
write a query to pull the fields you need for the form, and including the date-of-sale field. set criteria on the date-of-sale field as Between Forms!MyFormName!StartDateControl And Forms!MyFormName!EndDateControl the expression should be all on one line, regardless of linewrap in this post. replace MyFormName with the correct name of the form, and replace StartDateControl with the correct name of the control where you enter the beginning date of the date range, and ditto EndDate control for the ending date of the range. still in query Design view, choose Query | Parameters from the menu bar, and in the dialog box enter the two parameters, as each on separate lines, as Forms!MyFormName!StartDateControl Forms!MyFormName!EndDateControl with the corrected form and control names, of course, and assign Date/Time data type to each. last, turn the query into a Totals query by clicking the toolbar button that looks like a fancy capital E, or a capital M turned on its' side. Group By the salepersonID field (that's the default grouping assignment), and Count another field - that will be the total number of records in the query, grouped by each salespersonID. if you have a field showing dollar value of each sale, Sum that field, for total sales value. use the query as the form's RecordSource. hth joecosmi... (AT) gmail (DOT) com> wrote in message news:05b24761-ba59-4efd-a1f2-d44b80f1dfb1 (AT) b16g2000yqb (DOT) googlegroups.com...http://mail.avatel.us/1.jpghttp://ma...vatel.us/3.jpg I have provided links to 3 pictures which will hopefully help you understand what I’m trying to do. I need to be able to have a form that has each sales person’s name with a total number of sales for the given date fields that I enter. Since the form is in Continuous Forms mode, you can see that it lists all of the sale’s people who made sales between the dates I specified at the top. If you look at 2.jpg, you will see that I filtered the form to show only Evelyn’s sales but there are a bunch. I’m trying to get this form to show Evelyn only once (or any other user I filter) and then the number of sales he/she had. I want to be able to show all sales people as well but only show their names once and then the total number of sales they did between the dates I chose. Each sale’s person has their own unique ID and comes from a table called SalesEmployeeT. The table that contains the sales is called LeadDetailT. Every time someone creates a sale, it creates a single LeadDetail ID in that table, so one sale means one new ID created. There are fields in that LeadDetailT that reflect the total amount of sales and total amount of maintenance called TotalSales and TotalMaint. I use a simple formula to add both fields for a grand total. Thanks in advance. |
![]() |
| Thread Tools | |
| Display Modes | |
| |