how to sum and subtotal by project code in vs 2005 reporting service - reporting-services

I need to display the sub total for each project code as follow.I am using the VS2005 reporting service.
Code EmployeeName Projectcode Salary TotalIncome
Leave TotalDetact
000 Adam ADM 1000 1000
100 100
ELS 1100 1100
100 100
010 Eris ADM 15000 15000
500 500
Subtotalfor ADM 16000 16000 // I dont know how to do in here.
Project 600 600
2 persons
1 person ELS 1100 1100
100 100

It looks like you want to have a summary of the data by project at the end of the report? The problem is that you have multiple projects for people and you are ordering by person, so standard grouping won't work.
You have some alternatives:
Change the grouping to be project, then by person. Now you can summarize by project but of course you lose the person summary. Not ideal.
Create a second table in this report after the table you have in there now and do the summary there. You might want to create a new summary dataset for this table.
Use custom code (or a custom DLL) to do the calculating of the project summary for you. Right-click project surface-Properties-Code and you can write VBA functions in there that you can call from the table.
Use a subreport.
Option 2 is probably the easiest.

Related

How to do a partial copy/paste recordset

Under MS Access 2013, I want to copy a record to a new one or an existing record.
I wonder if it is possible to do a partial copy/paste.
Here is my simple example of my DataSet:
PayID PAyDate PeriodeName EmployeeID Income Taxes
001 2019/01/02 1 5 1500 201
002 2019/01/15 2 5 1500 201
003 2019/01/30 3 5 1500 201
004 2019/02/06 4 5
005 2019/02/06 5 5
Please note that
my complete datasheet has 12 fields which must be copied)
PayID is an autoNumber
I would like to be able to:
copy/paste Income and Taxes fields to an existing record (ex: PayId#3 to payId#4 )
copy/paste Income and Taxes fields to a new record (ex: PayId#3 to a new one, ie #6)
I already have a contextual menu in my datasheet with the standard copy paste command buttons but I don't know how to substitute them for a partial copy paste command.
What should I have as OnAction Callback functions?
callBackCopy()
callBackPaste()
Thanks for the support.
It may not be obvious, but you can Copy&Paste ranges of columns and rows (and both) in an Access datasheet. This works in Access 2010 and 2016, so I assume it works in 2013 too.
You need to move the mouse cursor to the edge of a cell, so it becomes a "+" icon.
Here is a sample video: https://i.imgur.com/H1VHIlo.mp4
(German Access, but you will get the idea)
It shows copying 2x2 cells into new records. You can do the same to overwrite existing records, then you must select the matching number of rows as copy target.

how do I find duplicate serial numbers in 2 separate columns in Microsoft access?

I am having an issue with Microsoft access running a query and don't know how to go about running the query I need. i am trying to find duplicate S/N's in 2 columns, for example
COMPUTER SN HARD DR SN MONITOR 1 SN MONITOR 2 SN
1 456 123 654
2 528 234 758
3 963 654 234
as shown above computer 3 is showing the same monitor from both 1 and 2 and I can get Microsoft access to show duplicates from up and down or side by side and I cant figure out how to do diagonal as well. I am using Microsoft access 2016 and any help would be great thank you. I have been looking for the past few days and I don't know what SQL is or how to do that in access but everything I can find shows me how to do up and down (I got that working) or direct side by side (I got that working as well) nothing showing me how to do diagonal as well.
so I had someone else from my work come up and help and we created a query with this in the comment block,
In (SELECT [MONITOR 2] FROM [COMPUTER S/N] WHERE [COMPUTER S/N].[MONITOR 2] NOT IN ("NA")) And Not In ("NA")
and had monitor 1 as the column selected. so it will take each S/N from monitor 1 and check monitor 2 for the same data, then I have to have another query for each column duplicates. the end phrase and not in ("NA") is only to take out the spots where people only have one monitor.

Showing a calculation of % of Referrals from from MD's in access

I have a table that is based on data entered into a form for new patients to our clinic. One of the parts of the form is a check box that shows if a patient will need one or multiple disciples (Speech, Physcial, Occupational, Feeding Therapies) to our staff and is stored in the tables as 0 and -1.
I would like a simple way to show how many we have for each discipline unsing a subform or query that I can then refrence and then calculate it as a %
Example:
ST: 550 55%
OT: 200 20%
PT: 100 10%
FT 150 15%
Total: 1000
We just recently switched from a Google Sheet for all this data to Access. I was able to do a very very easy and simple PivotTable with Sheets, but the pivot tables in Access make me want to throw things.
Welcome to MS Access. you can achieve this by using count function:
SELECT Count([Speech])*100/Count([patient_id]) AS TotalSpeech,
Count([Physical])*100/Count([patient_id]) AS TotalPhysical,
Count([Occupational])*100/Count([patient_id]) AS TotalOccupational,
Count([Feeding ])*100/Count([patient_id]) AS TotalFeeding
FROM tbl_patient;
of course you need to change the column names as per your table. the calculation is count(therapyType) * 100 divide by total patient = % of TherapyType used by patients.

Business Objects - Summarising Data in a Separate Report

I'm trying to make a neat 'front end' report tab (Summary) that just contains the summary information from another report tab (Report1) but I can't seem to get my summary working correctly.
I have some data (Report1) like so, where I have created a variable to flag if 'Value' is above 500:
ID Value Above
1234 400 0
2345 600 1
3567 200 0
5687 1000 1
So I want to sum up over 'Above' in a separate report tab (Summary). I can't find anything that works yet so any function ideas etc would be much appreciated.
Add a new query in the data provider which Counts the No of IDs with a value of 500 and more and use that Value to display in the main sheet.
Regards,
vijay
I found a solution to this:
=sum([Above]ForEach([ID]))

Access Expression problem: it's too complex, so how do I turn it in to a function?

Access 2007 is telling me that my new expression is to complex. It used to work when we had 10 service levels, but now we have 19! Great! I've asked this question in SuperUser and someone suggested I try it over here. Suggestions are I turn it in to a function - but I'm not sure where to begin and what the function would look like.
My expression is checking the COST of our services in the [PriceCharged] field and then assigning the appropriate HOURS [Servicelevel] when I perform a calculation to work out how much REVENUE each colleague has made when working for a client. The [EstimatedTime] field stores the actual hours each colleague has worked.
[EstimatedTime]/[ServiceLevel]*[PriceCharged]
Below is the breakdown of my COST to HOURS expression. I've put them on different lines to make it easier to read - please do not be put off by the length of this post, it's all the same info in the end.
Many thanks,Mike
ServiceLevel: IIf([pricecharged]=100(COST),6(HOURS),
IIf([pricecharged]=200 Or [pricecharged]=210,12.5,
IIf([pricecharged]=300,19,
IIf([pricecharged]=400 Or [pricecharged]=410,25,
IIf([pricecharged]=500,31,
IIf([pricecharged]=600,37.5,
IIf([pricecharged]=700,43,
IIf([pricecharged]=800 Or [pricecharged]=810,50,
IIf([pricecharged]=900,56,
IIf([pricecharged]=1000,62.5,
IIf([pricecharged]=1100,69,
IIf([pricecharged]=1200 Or [pricecharged]=1210,75,
IIf([pricecharged]=1300 Or [pricecharged]=1310,100,
IIf([pricecharged]=1400,125,
IIf([pricecharged]=1500,150,
IIf([pricecharged]=1600,175,
IIf([pricecharged]=1700,200,
IIf([pricecharged]=1800,225,
IIf([pricecharged]=1900,250,0)))))))))))))))))))
UPDATE (16/04/10 14:46 GMT)
I've built a new table as recommended below. Now it's matter of removing my expression and making my original SELECT query use the new table. However, I'm not at all clear on how this is done.
Using the DLookUP example I imagine I keep the original query where I have my PRICECHARGED field, include a new DLookUp field that uses the example below to refer to the PRICECHARGED and populate the rows with the appropriate SERVICELEVEL (hours).
I become confused at this point because in my original SELECT query all the calculation happened in that query (expressions, after expression), which meant that the final result of my query was a list of colleagues with HOURS, and REVENUE (Cost) against their name. I have a feeling that I'm in need of another query in the middle to manage the DlookUp process.
`Any directions or road map very much appreciated.
Final update. Added another table as mentioned above, created the appropriate links from the new table to the field in the 'fixed'table. Voila. It worked a charm, and without me doing anything that caused it to crash or give me an error warning. It was easier than I thought. I don't understand why I didn't manage it this way before.
Thanks again, Mike
You're making life really, really, really hard for yourself.
Create a table PriceToHours with columns PriceCharged and Hours. Put the appropriate rows into it so it matches the tabular data in your expression. Now JOIN that table to your main data table to get the Hours from the PriceCharged. When this information changes in the future, simply update the data in the table. This is much more transparent (no data hidden in a query expression) and requires no additional programmer time when the values change in the future.
I would suggest changing the way this works and keeping the service level to price charged logic in a separate table. This would allow you to change it quickly if the business need changed.
The table would just be as simple as two columns and “ServiceLevel” and “PriceCharged”. Then in your query link that to your table.
For a quick check however what would happen in the price charged was say 1105 i.e. not in the list? The function would possibly return a null which would then cause the expression to fail maybe that is causing it?
EDIT::
After a bit of searching around it looks like the maximum number of nested IIF statements in access is 10 hence why it worked fine before but now does not. Looks like your only option is to redesign it to how it should have been in the first place!
Put all the data into a table and do a dLookup! Here is a table called CostHours
Cost Hours
---- ------
100 6
200 12.5
210 12.5
300 19
400 25
410 25
500 31
600 37.5
700 43
800 50
810 50
900 56
1000 62.5
1100 69
1200 75
1210 75
1300 100
1310 100
1400 125
1500 150
1600 175
1700 200
1800 225
1900 250
And to get the hours from the cost, here is a dLookup
dLookup ("Hours", "CostHours", "Cost=" & 100)
This will return the hours where the Cost is 100. Use that value in your calculations.
The beauty of MS Access is that dLookup can sit in the same place you do your calculations - in code, in a report, in a query.
Instead of a DLookup, you can do this in a SQL Statement as well
"SELECT Hours From CostHours Where Cost" = & CostVariable