General :: Monthly Cleaning Program - Crosstab Query To Generate A Report
Jun 12, 2012
I want to create a report for the Monthly cleaning plan of a hotel. For each day, how many rooms need new sheets, how many need new towels etc.
At this point I can generate a report for any given day.
This could be an example of what I want to achieve
Code:
------------ Date | Date+1 | Date+2 | Date+3
New Sheets 2 1 0 2
New Towels 1 3 0 1
Full Clean 0 1 2 0
"Date" is a date tat you can set, after which you'll get the following 30 days("Date+1","Date+2" etc)
I thought that a CrossTab query would give me what I want,but using the wizzard I can't get the result that I want.
Haven't worked with crosstab queries before so maybe I'm doing something wrong, or maybe this isn't even possible with a crosstab query.
View Replies
ADVERTISEMENT
Jul 28, 2015
This is a query, report and vba question. I'm using Ms Access 2007.
TABLE 1: projectname, activityname, totalhoursworked, employeename
TABLE 2: employeename, employeelevel
TABLE 3: employeelevel, rate
I created a select query to join the info that I need.
SELECT QUERY 1: projectname, activityname, employeename, totalhoursworked, rate, cost (calculated field (totalhoursworked*rate))
I have 2 crosstab queries.
CROSSTAB QRY 1: ROW (projectname, activityname) COLUMN (employeename) VALUE (totalhoursworked (summed))
CROSSTAB QRY 2: ROW (projectname, activityname) COLUMN (employeename) VALUE (cost (summed))
I then created a 2nd select query with inner joins to join both crosstab queries on similar fields (activity & projectname).
SELECT QUERY 2: projectname, activityname, employeename (totalhoursworked as value), employeename (calculatedcost as value)
It gives me this:
However, I want it like this:
Those employeename... refers to more employees being added after a period of time. Hence I want to know if I could use vba to generate a report every time a button is pressed on a form? I know how to link the form to the query.
View 8 Replies
View Related
Jul 29, 2014
My database has a crosstab query that counts the number of hits by month. I have two columns that are named "Count of Material"(Frequency) and "Sum of ordered Qty"(Total ordered). I need add a colum to find the Average Monthly Demand by dividing the Total ordered/Frequency/number of months in the query. I have tried everything to make it work but can't.
View 8 Replies
View Related
Feb 4, 2013
I want to modify one report as "I have 3check boxes, when I select one then others should disable and the report I selected should be generate"
So I have to create additional check box. What is the code to create & generate the report by seleted check box.
View 1 Replies
View Related
Jul 1, 2013
We have a large split database with 3 users on a single site. We will soon be increasing this to 6 users across 2 sites.
One of the fields in the main table is "report number" where a line is given a unique number. Not every line is given this number, as it depends on the finished status of the product.
The numbers are currently hand written onto a sheet as they are used, which obviously avoids duplicates. This however will be near on impossible once the database is shared across 2 sites.
the format of the number is 00/0000 where the first two digits are the year, and the last four increase sequentially.
Is there a reasonably easy way to incorporate this into the database itself, where a number can be generated as required, as apposed to every time?
View 14 Replies
View Related
Sep 5, 2014
In given table name is formatted as:
HERNANDEZ JR, FELIX / BRADY, ANDEL
and I need to make it to "Felix Hernandez" How would I be able to clean up "/" , "JR," in my query.
View 8 Replies
View Related
Jan 28, 2015
I have a stored procedure created in SQL SERVER 2008r2
I have a form in access adp project with combo boxes, when I click the submit button I want the values chosen to be the parameters and the stored procedure called to generate a report
Is this possible .
View 1 Replies
View Related
Jan 23, 2007
Hello all
i need to create a text field and button in a form that will show all the records for a particular JobNo in a report once the txt has been typed and the button is clicked, i.e if I type JobNo001 I need to to create a report showing all the information for that JobNo(but there can be multiple JobNo's).
Do i have to create a query for this. I am new to this so please be gentle
Thanks
Chris
View 1 Replies
View Related
Apr 10, 2013
Using a table with employees, I created another with equipment that uses a lookup to assign each piece of equipment to an employee (more than 1 piece of equipment can be assigned to each employee)
I want to be able to select records using a form, either by checkbox or listbox of which employees to include in the report that shows what equipment each is assigned. The problem I am having is creating the form/code to create the and/or query to generate the report.
View 2 Replies
View Related
Dec 26, 2014
I am building a form that updates a query and then generates a report based on the updated query. I am having two problems;
1. I have successfully concatenated the "First Name" and "Last Name" fields in the query to appear as First space Last, but in the actual report I get a compile error. I've tried everything I can think of with no luck. This is what it looks like in VBA:
"SELECT [VoCSurveys].[First Name] & " " & [VoCSurveys].[Last Name] AS Name, ... " & _
2. I am trying to figure out how to update two labels (lblDescription and lblSecondaryDescription) on my report with the information the user types in the text boxes (txtDescription and txtSecondaryDescription) on the form. I tried calling a variable for each label and setting it equal to the corresponding text box, but I didn't think it would work and I was right.
View 3 Replies
View Related
Jan 20, 2008
Okay I have a report (rptHorneOstbergQuestionnaire) that is based on a query (qryrptHorneOstbergQuestionnaire). In the report I have a total (HOTotal) which is the result of an expression created in the qry. Based on this result I would like to generate text in a text field (HOType) that is found in the same report.
Basically if the field HOTOtal shows any vaue between:
16 and 30 then I want the unbound text field to show the text Definitely evening typw and so on ...(see case statement below)
I thought I could do a case statement on report open but I am getting an error that my expression contains no value.
Here is the case statement
Private Sub Report_Open(Cancel As Integer)
Select Case Me.HOTotal
Case 16 To 30
Me.HOType.Value = "Definitely evening type"
Case 31 To 41
Me.HOType.Value = "Moderately evening type"
Case 42 To 58
Me.HOType.Value = "Neither type"
Case 59 To 69
Me.HOType.Value = "Moderately morning type"
Case Else
Me.HOType.Value = "Definitely morning type"
End Select
End Sub
What else can I do?
View 2 Replies
View Related
Jun 30, 2015
I am create a database to track leave of my team.I have create the tracker and few reports, however now I want to create a report by applying filters in 2 places, for associate and for leave type or for associate and for joint leave or for associate and for Informed.I have SQL code which does not work. how can I select the other paramater with associate name using combox box in form.
Code:
SELECT Leave_Records.[Absent Date], Leave_Records.[Associate Name], Leave_Records.[Absent Day], Leave_Records.[Leave Availed], Leave_Records.[Joint Leave], Leave_Records.[Informed TL], Leave_Records.[Leave Type], Leave_Records.[Leave Applied], Leave_Records.Comments
FROM Leave_Records
WHERE (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Leave Type])=Forms!Report_Form!Leave_Type)) Or
(((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Joint Leave])=Forms!Report_Form!Joint_Leave)) Or (((Leave_Records.[Associate Name])=Forms!Report_Form!AssociateName) And ((Leave_Records.[Informed TL])=Forms!Report_Form!Informed));
View 1 Replies
View Related
Jul 14, 2005
Complex Report Query (CrossTab)
Hey everyone!
I need some help here, I am in the final design stages of my database… I am working on creating some reports and I need some help getting the info I need in the right place. Let me summarize the problem, then I will give you a rundown of my table structure and what I need to do, finally explain how far I am at this point.
I need to create, a complex query for use of a report I am creating. Here is a summary of what info the final query needs to include:
CurrentRank / LastYrRank / BusType / BusName / BusPhone / etc. / Cat1 / Cat2 / Cat3 / etc.
*******************
Here is my table Structure
*******************
|tblBusiness
|--------------
| &BusinessID
| BusinessTypeID-----1---1--1
| BusinessName | | |
| ….(etc.) | | |
| | |
|tblBusinessType | | |
|-------------------- | | |
| &BusinessTypeID--%/ | |
| BusinessType | |
| ….(etc.) | |
| |
|tblCategory | |
|------------- | |
| &CategoryID---------1 | |
| CategoryName | | |
| | |
|tblBusinessCategory | | |
|------------------- | | |
| &BusinessID----------- |--%/ |
| &CategoryID-------- %/ |
| &CopyYear |
| Value |
|
|tblRank |
|--------- |
| &RankID |
| &BusinessID------------------%/
| BusinessTypeID
| &Year
| Rank
1= one
%=many
&=PrimaryKey
Now, each BusinessType has several associated BusinessCategories (3-8)… all of the businesses use that set of categories to create a unique set of categories along with a value and a year. So, all businesses with a common businessType will have a common set of categories and values, and will have a set for each year
Additionally each business within a businessType is ranked by those categories for each year. (I am currently setting the business rank by year manually, though I will eventually create a module to do it for me.)
With me so far?
*************************
Here is The Report I need to make
*************************
BusinessType
|----------------------------------------------------------------------|
|Rank | |Telephone| | | | |
| 2006| Business | Fax | $ sold lt. yr| Type Meal | Owner | |
| 2005| Address |e-mail/web|(Category*)| (Category) | Category | etc.|
|-----|----------|-----------|------------|-----------|----------|-----|
| | Bus. 1 | phone | 23,405 | dinner/ | John Doe | |
| 1@ | Street | fax | | dessert | | |
| 1^ | State/Zip | email/web | | | | |
|-----|----------|-----------|------------|-----------|----------|-----|
| | Bus. 2 | phone | 20,185 | breakfast |Jane Smith| |
| 2 | Street | fax | | lunch | | |
| 4 | State/Zip | email/web | | | | |
|-----|----------|-----------|------------|-----------|----------|-----|
| | Bus. 3 | phone | 18,958 | lunch | Ron Man | |
| 3 | Street | fax | | | | |
| 2 | State/Zip | email/web | | | | |
|-----|----------|-----------|------------|-----------|----------|-----|
| | Bus. 4 | phone | 17,432 | lunch / | Bob Neff | |
| 4 | Street | fax | | dessert | | |
| 3 | State/Zip | email/web | | | | |
|-----|----------|-----------|------------|-----------|----------|-----|
| Footer |
|----------------------------------------------------------------------|
*=Ranking Category
@=currentYearRank
^=PreviousYearRank
Hope this is helpful… almost done…
*****************
Here is where I am at…
*****************
I have a query named QallBusinesses which contains all tblBusiness linked to tblBusinessCategory.
Then I have a Cross Tab Query named CTQGolfCourses (for instance) that limits the year and business type which gives me the below results
BusType / BusName / BusPhone / etc. / Cat1 / Cat2 / Cat3 / etc
This is great… it is almost finished… Now, I need the list to include the current year and previous year rank (lets say 2006, 2005 respectively) and sort the list of businesses according to the current year rank… (in case of rank ties sorting by business name) to end of with this:
CurrentRank / LastYrRank / BusType / BusName / BusPhone / etc. / Cat1 / Cat2 / Cat3 / etc.
That is where I get stuck! Can I create a nested Crosstab?
I have tried to create a query using CTOGolfCourses and tblRank linking BusinessID then crosstab that query to get the results I want, however it just ends up creating a records for each business type to have every available rank with every available year, so when I crosstab it, it ranks all the businesses as #1 for both years.
If I can lay this out manually, I know that I can code this using VBA to generate the exact reports I need, using the varying criteria, however I cannot quite get the results I need manually.
Wow, this is a long post! Thanks for hanging in there! I really appreciate any help you can give on this complex problem!
View 3 Replies
View Related
Feb 21, 2014
In a table, there's a column, "Siebel or Sales Ref". Some of these will have a long sales reference number or an ID from a Siebel sales system (pants), in the format 1-XXXXXXX. The problem is that some have two IDs, separated by a forward slash (/), so like 1-ABC1234/1-DEF5678. He wants to go through the data, and where there's a double ID, split it out, and create a new row with the second ID.
I'm not sure this can be done in Access, I would have done a loop in Excel, but it's his database.
Code:
INSERT INTO ActualBaseData
SELECT *
FROM (SELECT 'ITQ ID', Deadline, Lot, 'Bid Progress', 'Framework Type', 'Tender Type', 'Siebel or Sales Ref'
FROM TempBaseData
WHERE InStr('Siebel or Sales Ref', '/') = 0
[Code] .....
View 6 Replies
View Related
Mar 26, 2013
I made a report with following crosstab query.
TRANSFORM Workersdetail.workername AS CountOfedate
SELECT Workersdetail.[attendance], Count(Workersdetail.[edate]) AS [Total Of edate]
FROM Workersdetail
GROUP BY Workersdetail.[Workername], Workersdetail.[attendance], Workersdetail.[workerhourenter]
PIVOT site+Cstr([workerhourenter])
I wanted to know that, is there any option through which my report gets autoupdate or refresh incase of addition in SITE field (as mentioned with PIVOT)?
View 1 Replies
View Related
Apr 19, 2015
I've got a self updating crosstab query, its essentially a monthly summary and every month a new column is added (one corresponding to the current month, i.e., next month the new column will be may, following that the new one will be june, etc)
I've designed a report to be based on this query and i tested it out by manually adding data for next month into a table, the query auto updated however the report remained the same (ended in april instead of adding a new column for may).
Just curious if there is a way to automatically add these new columns to the report every month or will i have to do so manually?
View 1 Replies
View Related
Oct 9, 2013
I am trying to get a report that shows both column totals and row totals.
I have a crosstab query that gives me the Row totals along with the crosstab data.
I have read on a previous post [URL] ....
That I can union the crosstab to a select query which should get me what I want, but to be honest I am lost.
View 3 Replies
View Related
Apr 7, 2013
I am creating a crosstab query in VBA to report on claims on a paid and incurred basis. I would like the query to have 13 columns - one for each month of the current year and one for all claims paid prior to January of the current year.
Is there a way to lump all data with a date less than Jan 1 into a single field while retaining the monthly detail for the current year?
All of the data is coming from a single table. Sample code below functions, but provides a column for every month a claim was incurred.
Sub Triangle()
'Triangle Reports
'Check Registers
On Error GoTo Error_Handler:
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim QRY As DAO.QueryDef
[Code] ....
View 4 Replies
View Related
May 10, 2005
ok i think i know what i need (searching the forums gave me the idea)
i have query that generates a report, i need this report to be flitered monthly
is it possible to have afield where i enter the month so when i press the monthly report button it just prints any entries in that month
please can someone oint me in the right direction.
View 2 Replies
View Related
Aug 2, 2006
I am trying to create an inventory which list sales by month. I have created a crosstab query from the detail history table which works fine except I would like a record for each month whether there was sales or not. So on the report I would have all 12 months for each item with the months with no sales displaying zero.
Any suggestions?
Valerie
View 6 Replies
View Related
Jan 19, 2006
My boss wanted me to develop a way for a department to do a monthly report from Access. In the beginning, I set up a login for the user, then the user would input a start date and an end date to retreive the report. However, I just put part of the report up and will need to put what ever information they needed in the report. So, I did all the queries in Access and it produces correct result. Now I have to some how put it in ASP file including all those queries but dont know exactly how I would do it since I would not have a name for each query that I did in Access. Plus, in Access I used a fix date range to check the query and it works. So, I replaced 8/1/2005 with 'txtStartDate' and replaced 8/31/2005 with 'txtEndDate' and it works for one of the query. Now I when I looked at the rest of the queries I made in Access I would have to make some adjustment including the one that calculate the percentage from 2 queries. Below are several queries I made in Access but will need to somehow incroporate in ASP file.
(I replaced 8/1/2005 with 'txtStartDate' and 8/31/2005 with 'txtEndDate' in ASP file and it works. Need to do that with the rest of the queries)
Query1 (count number of record in group A)
Code:SELECT tblNatureOfCall.NatureDesc, SUM(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)) AS CountofLogsFROM tblNatureOfCall LEFT JOIN tblCallLog ON tblNatureOfCall.ID=tblCallLog.NatureOfCallIDGROUP BY tblNatureOfCall.NatureDesc;
Query1Total (Sum of count number of record of Query1 group)
Code:SELECT Sum(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)) AS CountOfDispositionOfPatientID, tblDispositionOfPatient.DispositionFROM tblDispositionOfPatient INNER JOIN tblCallLog ON tblDispositionOfPatient.ID=tblCallLog.DispositionO fPatientIDWHERE tblDispositionOfPatient.Disposition="TRANS"GROUP BY tblDispositionOfPatient.Disposition;
Query1Percent (This find the % from Query1 and Query1Total. Need a code to format in % form as 34.00 not .3400)
Code:SELECT (SUM(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)))/Total AS Expr1FROM tblNatureOfCall LEFT JOIN tblCallLog ON tblNatureOfCall.ID=tblCallLog.NatureOfCallIDGROUP BY tblNatureOfCall.NatureDesc;
Query1TotalPercent (This find the percent of a group out of the total of 2 groups)
Code:SELECT [Query1Total]![CountOfDispositionOfPatientID]/[TotalQuery]![Total] AS Expr1FROM TotalQuery, Query1Total;
Query2 (count number of record in Group B)
Code:SELECT Sum(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)) AS CountOfDispositionOfPatientID, tblDispositionOfPatient.DispositionFROM tblDispositionOfPatient LEFT JOIN tblCallLog ON tblDispositionOfPatient.ID=tblCallLog.DispositionO fPatientIDWHERE tblDispositionOfPatient.Disposition<>"TRANS"GROUP BY tblDispositionOfPatient.Disposition;
Query2Total (Sum of count number of record in Group B)
Code:SELECT Sum(Query2.CountOfDispositionOfPatientID) AS PatientIDTotalFROM Query2;
Query3 (count number of record of group C)
Code:SELECT Sum(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)) AS CountOfPatientDestinationID, tblHospital.HospitalNameFROM tblHospital LEFT JOIN tblCallLog ON (tblHospital.ID = tblCallLog.PatientDestinationID) AND (tblHospital.ID = tblCallLog.NotifyHospitalID)WHERE tblHospital.HospitalName <> "HCO"GROUP BY tblHospital.HospitalName;
TotalQuery (sum of Query1 count number of record and Query2 count number of records)
Code:SELECT Sum(IIf([dateofcall]>=#8/1/2005# And [dateofcall]<=#8/31/2005#,1,0)) AS TotalFROM tblNatureOfCall LEFT JOIN tblCallLog ON tblNatureOfCall.ID=tblCallLog.NatureOfCallID;
These are the queries done in Access but will need to incroporate in ASP. Query1 is already in ASP, just need to add the rest of the queries. Dont know how I would do it.
View 1 Replies
View Related
May 5, 2014
I am constructing a database for a friend and need to filter data from a daily log to enable a report to be generated for each months actions. I have created fields of: entry date, month and year with the view of filtering by month and year. How do I perform this task?
View 3 Replies
View Related
Apr 22, 2015
I have a query for loan calculation, fields are;
Loanamount
loandate
monthlyinstalment
what i want is that query to start subtracting lmonthlyinstalment from loanamount on monthly basis
View 3 Replies
View Related
Jun 1, 2013
I've got a simple invoice database with 10 amount fields, that needs to be summed up intoa Total including Gst box on a monthly report.
Report only has Date, Invoice Number And Total Amount fields on it, so I need to pull the information from table and sum it into Total Amount.
ie. = sum ( t1 +t2 + t3 + t4 + t5 + t6 + t7 + t8 + t9 + t10)
and sum above divided by 10% then added together to form total.
I'm just not sure how to do it, everything I've tried so far ain't worked.
Every example I've looked at is only doing maths with 1 field.
View 4 Replies
View Related
Mar 10, 2015
how to create the report monthly,year and weekly using access 2007?
View 3 Replies
View Related
Mar 12, 2013
i have a table on my database from which i generate a monthly report by running a query. when i run the query (date from to date to) i have no problem. it shows me all the relevant records. when i want to generate a report, i input the start date and the closing date for the report. it then gives me an error (reserved error (-1524); there is no message for this error.) i have gone into the table and basically isolated all the corrupted entries. there are 359
what i need to know is how to repair these entries without losing the information. im new to access and this is a simple(kinda) database which i set up to keep track of what the staff in my department are doing on a daily basis.
im running access 2007.
View 7 Replies
View Related