I have a Report that shows the following:
1) Name of Claim Processor
2) Total Claims Processed
3) Total Errors in Claims Processed
The criteria for the select query underlying the report is a date range (ProcessedDate) which is entered from a form that the end user accesses. This date range is typically for a month, for example 05/01/2013 through 05/31/2013.
Here is the issue I'm having trouble with, the user wants to see items 1, 2, and 3 above summarized by the WEEK in addition to a grand tally for the month (or whatever the date range is).
I have no problem getting the individual dates for each week within the month/date range, however, I can't figure out a way to dispay the grouping by week separately on the same report. Is it possible to have multiple text boxes with each text box's control source set to a different DLookup function or SQL Select query that restricts by the weekly dates? For example:
Week of 5/6/13 thru 5/10/13 Processor | #Claims | #Errors
Week of 5/13/13 thru 5/17/13 Processor | #Claims | #Errors
Week of 5/20/13 thru 5/24/13 Processor | #Claims | #Errors
Week of 5/27/13 thru 5/31/13 Processor | #Claims | #Errors
Thanks in advance for any ideas on how I can approach this!
7 1698
You can use the Format() function to return the week number in the query and group by that. As for the monthly grand total, you can just put a sum at the end of the report since your date range is for a month anyways.
I think I'm pretty close to a solution on this but now I'm stuck on an expression.
So I went with a report based on a crosstab query that is structured like this: - Supervisor (Group by Row Heading)
-
| Manager (Group by Row Heading) |
-
Expression: DateAdd("d",1-Weekday([ProcessedDate],2),[ProcessedDate])
-
Group by Column Heading |
-
CountofClaims Sum of Value |
-
TotalCount of Claims Sum of Row Heading
The part giving me problems is the expression: - DateAdd("d",1-Weekday([ProcessedDate],2),[ProcessedDate])
That expression will return the date of the Monday before Sunday. So weeks
run from Monday to Sunday. How do I make the week run from Monday to Friday only? I am trying to sum by week for weekdays the # of claims done by processer by supervisor and manager. For example, I know the week of 5/13/13 (Monday) thru 5/17/13 (Friday) a particular processor completed 40 claims, however, using this function, it shows that the processor completed 50 claims for the week of 5/13/13. Others processors show 60 per week, when it should be no more than 50.
I am so close on this and would really appreciate any help on the expression syntax, thank you!
It would be more helpful to see the SQL.
As far as the date range goes, if you can get the sunday, then getting the friday is merely subtracting two days from sunday.
Here is the SQL code... - TRANSFORM Sum(Qry_QSRWeeklyRpt_NCDev_Step2.CountOfUpdater) AS SumOfCountOfUpdater
-
SELECT Qry_QSRWeeklyRpt_NCDev_Step2.Updater, Qry_QSRWeeklyRpt_NCDev_Step2.tmm_last_name, Qry_QSRWeeklyRpt_NCDev_Step2.tmm_first_name, Qry_QSRWeeklyRpt_NCDev_Step2.Supervisor, Qry_QSRWeeklyRpt_NCDev_Step2.Manager, Sum(Qry_QSRWeeklyRpt_NCDev_Step2.CountOfUpdater) AS [Total Of CountOfUpdater]
-
FROM Qry_QSRWeeklyRpt_NCDev_Step2
-
GROUP BY Qry_QSRWeeklyRpt_NCDev_Step2.Updater, Qry_QSRWeeklyRpt_NCDev_Step2.tmm_last_name, Qry_QSRWeeklyRpt_NCDev_Step2.tmm_first_name, Qry_QSRWeeklyRpt_NCDev_Step2.Supervisor, Qry_QSRWeeklyRpt_NCDev_Step2.Manager
-
PIVOT DateAdd("d",1-Weekday([ProcessedDate],2),[ProcessedDate]);
-
Updater is the Claims Processor and CountofUpdater is the total # of claims processed.
I guess my question is that I don't really understand how to get the start and the end day for the DateAdd function and still display the week starting date as the column heading. I know it's probably really simple but I'm still stumped.
If you want to append two strings, you can use the & operator. For example: "cat " & "dog"
Will return: cat dog
Yay! I figured it out:
To exclude Sat and Sun records I calculated another field for the day of week and applied filter criteria: - DayOfWeek: Format([ProcessedDate],"ddd")
-
-
<> "Sat" And <> "Sun"
Glad you got it working. Good luck with the rest of your project!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jamiemcc |
last post by:
Hi,
I would like to have 1 stored procedure call another stored procedure
(which contains multiple select statements) and then be able to access
the 3 result sets.
Example
Create Procedure ....
|
by: Harry V |
last post by:
I'm wondering if there is a limit of a single select, delete and insert statement (command) to each dataadapter? On a form, I have a dataconnection that is shared by 3 dataadapters, one for each of...
|
by: Joe via DotNetMonster.com |
last post by:
Hi,
I'm trying to use several select statements so that I don't need to call
the function several times. The next Result set always seems to read the
first select statement. I have the...
|
by: jonvan20 |
last post by:
I have been having trouble with a simple Dlookup command that was Reccommended to me by a nice fellow named Vic, On the other hand I have statements like this that wont run they give me a run time...
|
by: =?Utf-8?B?VGVycnk=?= |
last post by:
I have coded multiple select statements in a single stored procedure, and
when I execute this procedure on SQL Server Management Express, I correctly
get multiple result sets. But, if I try to add...
|
by: musman |
last post by:
hey all,
I have tried to use the select statement instead DLookUp function as i have sql server at my backend and access as my front end.
But neither DLookUp function is working nor select state...
|
by: vertigo262 |
last post by:
Is it possible to use to select statements in a stored procedure?
I am building a movie rating system, what I am doing is creating a table with movies and individual user ratings.
The code...
|
by: golffor1 |
last post by:
Hello I was wondering if you could help me out with doing multiple select statements.
I have this
objCommand.CommandText = "Select * from table"
objCommand.CommandText1 = "Select * from...
|
by: els12 |
last post by:
How do I write 2 distinct select queries in one sql statement, and then also divide the results of one by the other?
The first query will give me a subset of all the records in the table...the...
|
by: pattyd |
last post by:
I have multiple queries that will run on my onopen event of my report. I use the docmd.openquery for the select queries the problem is I can see all these popup in the background. I do use the close...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |