Help Pls! Calculated Grouped Querry

Jul 30, 2007

Hi Guys,

can anybody help me on the below?

i need to generate a query contains

name, project, total_Hours_worked (only if total is >45) for a week by each employees. the query should contain total hours for all the weeks.
The table contains week_ID column and dyas worked column.
i can create a query which gives me sum of day_hours worked using selecct sum(day_hours) as Total.

but i badly need total sum of week hours worked by each employees. so that i can generate overtime report grouped on weekly who has woked more than 45 hours per week.

the table is attached. please see and help me if you can.

Thanks
Kiran Konsaai

View Replies


ADVERTISEMENT

Families Grouped Together

Nov 16, 2005

Hi,

I want to make a church database grouping families together and identifying each persons position in the family while still having each family member with an individual profile, i.e. birthdays, anniversaries, position, classes, memos, possibly donor info.

How do I do this?

Thanks

View 1 Replies View Related

Merging Grouped Data?

Apr 3, 2008

So i'm not sure where this post belongs as it may encompass several items.
I have an excel sheet where every row has an email address and a product purchased. I've imported it all into access but would like to run a query to find out how many people that bought x purchased y. Or tell me how many people that x did not buy a,b, or c.

Part of the problem is that each record is one product. My data looks like this:

email: Product:
e1 p2
e1 p7
e1 p33
e2 p2
e2 p9
e3 p1
e4 p1
e4 p3

I was able to group some of the data by email address in access but can't figure out a good way to query it. I'm thinking I probably need to merge the data where each unique email address is a record and the products have all the products purchased instead of just one but I really have no clue how to do that.

Is this easily do-able? how would I go about this?
Thanks alot!

View 2 Replies View Related

Grouped Counts Using Criteria

Jun 12, 2007

Ok, I'm missing something simple here I'm sure, but I can't see the wood for the trees at the moment.

background guff
What I have is a system tracking actions being undertaken. There's an SLA for these actions which means they should be completed within 10 days. At the moment we have no reporting on whether or not we're meeting this SLA.

Now obtaining the information for all the data this year is fine and dandy and works ok. Where I'm having problems is doing a monthly breakdown for the ytd.

I'm using the following query to give me my raw data:
SELECT [Parent Table].ID, [Parent Table].[Date entered into database],
[Parent Table].[Leave Date], [Parent Table].DateCompleted,
DateDiff("d",[leave date],[datecompleted]) AS DaysToCompleteFromLeaving,
DateDiff("d",[date entered into database],[Datecompleted]) AS DaysToCompleteFromEntered,
DatePart("m",[leave date]) AS [month]
FROM [Parent Table]
WHERE ((([Parent Table].[Date entered into database])>#1/1/2007#)
AND (([Parent Table].[Leave Date])>#1/1/2007#)
AND (([Parent Table].DateCompleted) Is Not Null));

Which gives me the various dates, the number of days it took to complete the record from when a person left the company ,from when their information was loaded into the database and finally a number for the month.

I have a query that happily gives me the average completion times on a monthly basis:

SELECT Avg(CInt([DaysToCompleteFromLeaving])) AS AvDaysFromLeaving,
Avg(CInt([DaysToCompleteFromEntered])) AS AVDaysFromEntered,
[Completed Leaver Dates].month
FROM [Completed Leaver Dates]
GROUP BY [Completed Leaver Dates].month;


but I seem to be having a great deal of difficulty specifying criteria on a Count to show me the same breakdown.

I can get a total count of records per month:
SELECT [Completed Leaver Dates].month,
Count([Completed Leaver Dates].DaysToCompleteFromLeaving) AS CountOfDaysToCompleteFromLeaving
FROM [Completed Leaver Dates]
GROUP BY [Completed Leaver Dates].month;


But what I want to do is split that number into two columns, records where the completion date was >10 days and records where the completion date was <= 10 days which is where I'm having some problems.

Putting a critera in design view for the count field still returns the total number of records per month and returns the following SQL query:
SELECT [Completed Leaver Dates].month, Count([Completed Leaver Dates].DaysToCompleteFromLeaving) AS CountOfDaysToCompleteFromLeaving
FROM [Completed Leaver Dates]
GROUP BY [Completed Leaver Dates].month
HAVING (((Count([Completed Leaver Dates].DaysToCompleteFromLeaving))>10));
I'm fairly sure it's in the HAVING clause, but I'm not sure what I'm missing.

View 1 Replies View Related

Report Detail Grouped By Possible?

Nov 29, 2007

Hi,

I'm trying to create a report that separates info depending on Prodno. For now it lists all the right information like this

Code:Product Aisle Rack Shelf0218 7 6 20775 5 6 20775 4 4 40775 0 1 30963 1 1 71000 7 4 61000 2 3 71006 8 8 8

which is fine and dandy. What I would prefer is it do like this

Code:Product Aisle Rack Shelf0218 7 6 20775 5 6 2 4 4 4 0 1 30963 1 1 71000 7 4 6 2 3 71006 8 8 8

I am assuming it is some kind of group by in the details section? Any help would be great,

Thanks,

View 2 Replies View Related

Show Grouped Date In Chart

Jan 18, 2006

Hi!

I use MS Graph and need show 2 data types:
1. Invoice Value, EUR
2. Date
Date axis group records by month, for Example Period from 2005.01.01 And 2006.01.01 has 12 positions in Date Axis.
Her I have problem: I need show sum of Values for every month.
For example in Period from 2005.01.01 till 2005.02.01 I have 3 Values: 200, 500, 600EUR. Her I need to show 1300EUR, and so every month. Her is my strandart code:

Dim strSQL1 As String
strSQL1 = "SELECT Date As Date, Value FROM Table WHERE (Date BETWEEN 2005.01.01 And 2006.01.01)"
Me!chrStatistik.RowSource = strSQL1

Thank You in advace for help.

View 5 Replies View Related

Eliminating Duplicates In A Grouped Report

Aug 23, 2006

OK, first time posting so I'll try to be clear here. I work for a special education agency and have created a database to track student/therapist information. Now, I have reports showing which kids are in which schools and who their therapists are. What I can't figure out is how to print a report, grouped by school, that will display which therapists are active in that school.... any ideas?

View 1 Replies View Related

Queries :: Selecting Max From Grouped Data

Nov 26, 2014

I am having trouble writing what I think should be a fairly straight forward query... I am have a table with 2 fields, the first contains a list of subjects, the second contains a list of scores that students got in their tests in that subject.

So the data looks like this:

Maths 54
Maths 69
Maths 41
English 71
English 55
Art 44
Art 43
Art 66

I would like to write a query that selects only the highest score for each subject and presents it like this:

Maths 69
English 71
Art 66

View 4 Replies View Related

Reports :: Grouped Totals Report

May 8, 2013

I have a table with:

Invoice Number | Customer Name | Item | Item Cost | Invoice Date | Paid | Date Paid

Example of data:

AK001 | A Brown | Blue Car |1000 | 1/4/2013 | Yes | 20/4/2013
AK001 | A Brown | Red Car |2000 | 1/4/2013 | Yes | 20/4/2013
AK001 | A Brown | Yellow Car |500 | 1/4/2013 | Yes | 20/4/2013
AK002 | A Brown | Black Car |1000 | 7/4/2013 | Yes | 20/4/2013
AK003 | B Smith | Blue Car |1000 | 12/4/2013 | Yes | 25/4/2013

I want to create a report from this table that outputs as:

Invoice Number | Customer Name | Total Price | Invoice Date | Paid | Date Paid

Example of report from Example Data:

AK001 | A Brown |3500 | 1/4/2013 | Yes | 20/4/2013
AK002 | A Brown |1000 | 7/4/2013 | Yes | 20/4/2013
AK003 | B Smith |1000 | 12/4/2013 | Yes | 25/4/2013

Is there an easy way to do this.. or will I need to make a new linked table with the invoice number as a lookup?

View 2 Replies View Related

Assigning Grouped Attributes To A Record

Sep 30, 2011

I'm creating a database of companies. Every company has at least one field of services they provide. There are three main groups which contain all the services (Let's say I have three tables).

What I need is to have a form/table (query?) where I can assign to a company any number of services from any group. Is it possible to do it in a form where I could simply add a service by choosing a group first and then a proper service, and then add more in the same way?

View 3 Replies View Related

AND/OR Querry Help

Sep 16, 2007

Guys,


Could you please help me to make a query with the below conditions from the attached test.mdb file?

1. Enq Received Date 10 days before the search date AND/OR
2. Technical Sub Date 4 weeks in advance of the search date AND/OR
3. Potential Date 4 weeks in advance of the search date

The querry will display all the records which satisfies the above conditions.

Thanks in Advance.

Prajith

View 11 Replies View Related

Querry!!

Oct 17, 2006

I have a table, [temp_indicateur] which has fields [id,libelle_court,description,calcule,resitute,orig ine,seuil_min,seuil_max]
[number,text,text,boolean,boolean,boolean,number,nu mber]

My querry is this: insert into temp_indicateur (id,libelle_court,description,origine) values (" & rs!id & ",'" & rs!libelle_court & "','" & rs!description & "'," & rs!origine & ")"

But it gives me an error: Too little parameters

The table has no primary keys and no foreign keys. rs!id is the value of an earlier querry which I am running. Independently, I get the values of rs correctly but I can't get them to execute in this querry.

View 2 Replies View Related

Generating Reports For Individual Grouped Records

Oct 19, 2006

This probably is a very stupid question but I am a new user and have been pulling my hair out for a week over this. I have created a report and linked it to my table but it generates a list of all of the values in my table on the report. What I want is a way to generate a report page for every row in my database table grouped on a key record that is unique to each data row. If anyone has any advice it will be much appreciated, thanks.

View 1 Replies View Related

Queries :: Add Columns To Grouped Max (date) Query

Mar 14, 2013

I have a database that tracks students and their test scores. I am trying to figure out a way to where it will pull the student's latest test score and compare it to see if they fall within standards. So far I have 3 tables.

tblStudents
studentID
studentName
studentEmail

tblResults
resultID
resultStudent
resultDate
resultTest
resultScore

tblTests
testID
testName
testPassScore

The query I have written looks like this: SELECT tblStudents.studentID, Max(tblResults.resultDate) FROM tblStudents LEFT JOIN tblResults ON tblStudents.studentID = tblResults.resultStudent GROUP BY tblStudents.studentID." The data pulls just fine at this point. What I'm trying to figure out is how to then add more columns to this query to start doing comparisons. When I try to add more columns it tries to use them for additional grouping and adds many more records.

View 8 Replies View Related

Queries :: Totals Query Grouped Across Columns

Mar 5, 2015

I have simple table data structured as follows;[Origin], [Code], [Weight]. The Code field is a lookup field that will contain one of 8 choices; 10, 13, 13c, 23, 25, 27, 27a, & other. The other fields are pretty much self explanatory. Sample data would look like this:

Code:
Origin Code Weight
Edison 13 4.25
Edison 13c 2.87
Piscataway 10 5.45
Middlesex 23 1.24
Edison 13 5.21

What I need to create is a totals query where I first group by origin value, then a column for each "code" value which totals the weight for that "code". A sample output would look something like this:

Code:
Origin 10 13 13c 23 25 27 27a other
Edison 9.46 2.87
Piscataway 5.45
Middlesex 1.24

The only way I can think to accomplish this is to restructure the original table to include a field for each code and enter the weight in the appropriate 'code' field. If this is the only solution then Ill have to live with it, but is there any way to create this output using my original structure?

View 1 Replies View Related

How To Create Aggregate Sales Grouped By Product ID

Nov 6, 2014

I have created a Query that shows

The Product ID, Product Name, Quantity, Price, Gross Margin, Sales, Profit.

The only problem is that in the two tables I was given in my assignment, there were multiple dates for the purchase, thus even though I have 74 products there is multiple listings i.e.

110-10 Sofa Chair 5x $2 profit:$10 - october 11
110-10 Sofa Chair 6x $2 profit:$12 - october 12

I need to group it so that it becomes this.

110-10 Sofa Chair 11x $2 profit:$22

The date/location is not important, only the aggregate sales. Here is my SQL ....

SELECT SALES.PRODUCT_ID, PRODUCTS.ITEM, PRODUCTS.PRICE, SALES.QUANTITY, PRODUCTS.GROSS_MARGIN, Sum([Quantity]*[Price]) AS Sales, [Quantity]*[Price]*[Gross_Margin] AS Profit, PRODUCTS.WIDTH, PRODUCTS.DEPTH
FROM PRODUCTS INNER JOIN SALES ON PRODUCTS.PRODUCT_ID = SALES.PRODUCT_ID
GROUP BY SALES.PRODUCT_ID, PRODUCTS.ITEM, PRODUCTS.PRICE, SALES.QUANTITY, PRODUCTS.GROSS_MARGIN, [Quantity]*[Price]*[Gross_Margin], PRODUCTS.WIDTH, PRODUCTS.DEPTH, SALES.TRANSDATE
HAVING (((SALES.TRANSDATE)>=#9/1/2011# And (SALES.TRANSDATE)<=#12/31/2011#))
ORDER BY Sum([Quantity]*[Price]) DESC;

Nordic_Inventory1.zip

View 11 Replies View Related

Use Count In Querry

Jul 19, 2005

My current table

ClassName PropertA
ClassA 1
CassA 2
ClassB 2
ClassA 3
ClassA 2
ClassB 2

THis is my sample table with two columns. Property A can have 3 values 1,2 and 3. I want TO SELECT 4 columns such as classname, CountOf1, CountOf2, CountOf3. I just want ClassA in one row and at the same time get the number of 1's, 2's and 3's for that classA in seperate columns in the same row.
I appreciate your time. Please Let me know how to
write this querry.

View 1 Replies View Related

Update Querry

Nov 28, 2005

Hello,
This may sound too common a question, but I really need help on it. Prior querries in the same do not seem to solve it.

I have two tables, table1 and table2 with the following fields
table1 ( ACID, name, address, Salary, MStatus,Age)
table2 ( ACID,salary, Age)

ACID is the common field in the two tables ( primary key in table1)

Required

I need to update table1 with the colums in table2 for all the similar ACID in in table1.

Basically, after teh update, table1 will have all the information it had before the update, but a few fields will have changed coz of teh new information coming from table2.

Please help with the code. I'm using access, and the table structures are all the same.

Thanks in advance

View 1 Replies View Related

Update Querry

Feb 21, 2006

I have these three tables A, B, C and D. IN table A, SSN is the primary key. Tables B, C, and D have other columns, but the also have SSN as one of the columns. Also SSN is NOT required in other tables.

What I need to do is to be able to run an update querry that will update the value of the SSN in table A, and in any other table that will have that SSN.

I use Access 2000

View 1 Replies View Related

Simple Querry Help

Oct 25, 2006

I Have A Querry That Adds The Amount Of A Certain Light Bulbs I Have Order Since 2003. I Then Subtract The Amount Of That Light Bulb I Have On Hand Now...it Gives Me The Amount I Have Used Since 2003. Now I Want The Querry To Take That Number And Divide It By The Numberber Of Months Its Been When The Querry Was Open.

Example...i Open The Querry 10-23-06
It Tells Me The 60 Watt Bulb
Has Been Ordered 900 Times Since 12-2003
I Have 300 In Stock On 10-23-06
I Have Used 600 Since 12-2003

The Querry Needs To Give Me This Answer
You Use 17 60 Watt Bulbs A Month

View 6 Replies View Related

Up-date Querry?

Nov 20, 2007

hello all,
i would very much like anyones help with this,, i'm hoping its not too much to ask,, the story is a sfollows,,, i have two tables both conatining the same fields,, table 1 has approx 1k entries, where table 2 has approx 400 entries,, the data in table 2 is the newer data. what i would like to do is run a querry that would enable me to 'post' the data from table2 into table1,, for example table 1 has activity jc111 at 10% where table2 has jc111 at 20%,, if i could simply run this querry that would generate a new table or just up-date table1 my life would be very much better,, i really appreciate anyones help
- please remember that i'm quite new to this
thank you very very much in advance
best regards

View 3 Replies View Related

Querry By Primary Key? Is It Possible?

Mar 14, 2008

Hi,
I am just starting with access and dbs and already have a problem

i am working on a db for managings goods being retured

my db has particular tables:

GOOD
GUpc (PK)- unique product code
GDescription

PERSON
PReference (PK)
PName
PSurname
PTel
PMail

COMPANY
CReference (PK)
CName
CAddress
CTown
CPostcode
CCountry

RGA
RGAReference (PK)
CReference (FK)
PReference(FK)
GUpc(FK)
RGADate
RGASatus
RGACostOfRepair

I managed to get a query working so that i can search the PERSON table searched by surname

PARAMETERS [PSurname] Text ( 255 );
SELECT PERSON.PReference, PERSON.PName, PERSON.PSurname, PERSON.PTel, PERSON.PMail
FROM PERSON
WHERE (((PERSON.PSurname)=[PSurname]));

but i cant get it to work i wanted to search it by PReference

PARAMETERS [PReference] Text ( 255 );
SELECT PERSON.[PReference], PERSON.[PName], PERSON.[PSurname], PERSON.[PTel], PERSON.[PMail]
FROM PERSON INNER JOIN RGA ON PERSON.PReference=RGA.PReference
WHERE (((PERSON.PReference)=[PReference]));

I get a msg that The expression is typed incorectly or is to complex to be evaluated. For example a numeric expression my contain too many complecated elements. Try symplyfing the expression by assigning parts if the expression as variables.

AND THIS IS NO HELP FOR ME... francly

The same situation is with all the other tables- its possible (query- search) for everything apart for the primary keys.

I prepared a querry gathering data from all those tables. I managed to get it work with parameter like the one below with surname

PARAMETERS [PSurname] Text ( 255 );
SELECT COMPANY.*, RGA.*, PERSON.PName, PERSON.PSurname, COMPANY.CName, GOOD.GDescription
FROM PERSON INNER JOIN (GOOD INNER JOIN (COMPANY INNER JOIN RGA ON COMPANY.CReference = RGA.CReference) ON GOOD.GUpc = RGA.GUpc) ON PERSON.PReference = RGA.PReference
WHERE (((PERSON.PSurname)=[PSurname]));

but the same situation again, i cant get it to work if i want to get it for RGAReference, CReference, PReference,GUpc

I don't know what i am doing wrong?
have I designed it all wrong or is it just a small thing...

Thank you for all your help







My problems started when I tried to run a querry that will return the GDescription (this tables store data about 3000 products)

View 2 Replies View Related

Search Querry

May 6, 2005

I have created a search form made up of a number of different boxes. In my querry for the search I am using the following statement:

Like "*" & [Forms]![Search]![ExerciseName] & "*"

I a have a number of theses all saying similar things. At present I have to put something in each of the search boxes. Is there a way that I can leave a box blank and still search by other criteria. If I leave a box blank at present it returns no results.

View 11 Replies View Related

Querry Problem

Sep 20, 2004

Hello All
This might be an easy problem but I am not quite sure how to go about solving it. Presently I have a querry that is linked to a form so that when a person selects a role from the drop down list and you click search it uses the elment selected in the drop down list to show the coreesponding users. My probelme now is that I want to be able to select two different roles and use this querry to give me the users corresponding to these 2 roles. I would really appreciate your help what I have tired to do is create a new combo box and named it role 1 (the first one was named role) and then in the query in the criteria i tired to put the following
[Forms]![Users To Role Search Engine]![Role, Role1]but that give me nothing I am sure there is a flaw in my logic but I am not sure how to solve this. Thank you for your help

View 2 Replies View Related

Weird Querry!!

Oct 13, 2006

Hi,

I have this querry but when I execute on a button click it dosen't give me any error....but no data is saved in the table, why????

strSQL = " UPDATE DISTINCTROW projet set id='" & txt_id.Value & "',code_NOP='" & txt_code_NOP.Value & "',client='" & txt_client.Value & "',libelle_projet='" & txt_libelle_projet.Value & "',id_clarity='" & txt_id_clarity & "',technologie_projet='" & txt_technologie_projet.Value & "',em='" & txt_em.Value & "',date_debut=#" & txt_date_debut.Value & "#,date_fin=#" & txt_date_fin.Value & "#,site_mandataire='" & txt_site_mandataire.Value & "',charge_totale=" & txt_charge_totale & ",ca_total_vendu=" & txt_ca_total_vendu.Value & " WHERE id='" & Form_projet.id.Value & "';"

View 7 Replies View Related

Problem With Querry?

Dec 1, 2006

I have a string which I want to use as a querry, but its giving me an error saying "object required" even before executing the querry..

strSQL = "INSERT INTO projet (id,code_NOP,client,libelle_projet,id_clarity,tech nologie_projet,em,date_debut,date_fin,site_mandata ire,charge_totale,ca_total_vendu,no_sous_fon,no_ec rans_s,no_ecrans_m,no_ecrans_c,no_traite_s,no_trai te_m,no_traite_c,no_impression_s,no_impression_m,n o_impression_c,prov_risque,prov_garantie)" & _
" values('" & txt_id.Value & "','" & txt_code_NOP.Value & "','" & txt_client.Value & "','" & txt_libelle_projet.Value & "','" & txt_id_clarity.Value & "','" & txt_technologie_projet.Value & "','" & txt_em.Value & "',#" & Format(txt_date_debut.Value, "mm/dd/yyyy") & "#,#" & Format(txt_date_fin.Value, "mm/dd/yyyy") & "#,'" & txt_site_mandataire.Value & "'," & txt_charge_totale.Value & "," & txt_ca_total_vendu.Value & "," & txt_sous_fon.Value & "," & txt_ecrans_s.Value & "," & txt_ecrans_m.Value & "," & txt_ecrans_c.Value & "," & txt_traite_s.Value & "," & txt_traite_m.Value & "," & txt_traite_c.Value & "," & txt_impression_s.Value & "," & txt_impression_m.Value & "," & txt_impression_c.Value & "," & txt_prov_risques.Value & "," & txt_prov_grantie.Value & " );"

Can anyone solve it?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved