Dividing Rows Into Groups By Hours

Aug 28, 2006

Not sure whether this would be easier in a query than in VBA.. but I'm new to this:9

I've got a guest list for a big party, and one of the fields "Arrival" is a DATE/TIME field where it says when the guest entered the premises.
What I want for reporting purposes is to divide guests into nine "arrivalgroups", a number field I've added to the table in casu.

The groups look like:
117-18(or <16:00 AND >=18:00)
218-19
319-20
etc. all the way up to 9, last group being 01:00-02:00

That is, if the guest arrived between 20 and 21, the table field "arrivalgroup" would be set to 4.

Any easy way to do this?

View Replies


ADVERTISEMENT

Queries :: Counting Rows In Query Groups - Invalid Argument To Function

Jan 3, 2014

I have a query with about 7500 records that are grouped as follows and sorted by Mtr_Reading

ID Name Event_Start_Time _Hour, Mtr_Reading
2210 XYZ 7/15/2013 13:00 17 150
2210 XYZ 7/15/2013 13:00 14 143
2210 XYZ 7/15/2013 13:00 16 115
2210 XYZ 7/15/2013 13:00 15 110
2210 XYZ 7/15/2013 13:00 13 100
2210 XYZ 7/16/2013 12:00 12 100
2210 XYZ 7/16/2013 12:00 17 150
2210 XYZ 7/16/2013 12:00 14 147
2210 XYZ 7/16/2013 12:00 13 113
2210 XYZ 7/16/2013 12:00 18 110
2210 XYZ 7/16/2013 12:00 15 100

There are about 75 distinct sets of ID's and Names not shown here

The rows were sorted by the Mtr_Readings and we have to take the best four readings out of each group and average them. If a group has more than four rows then the top 4 are taken out and the balance is discarded. If the group has four rows or less all of the rows are taken.

I did try nested select statements and kept getting "invalid argument to function" exceptions.

View 14 Replies View Related

Queries :: Subtract 8 Hours Of Work From Result Hours

Nov 29, 2014

I want to subtract 8 hours of work of the Result of employee work hours/

There is attachment...

View 3 Replies View Related

SQl Query For Dividing A Field

Jul 13, 2006

I have to write a SQL statement which can divide Field1 and put the result sets in another field.In plain English I want to say, In Field1 if there is a Comma, put the letters between 2 commas, in field 2, If there is another comma put it in Field3
Field1 is an adress field and has values like 19 Stoney Gardens, Livingston, West Lothian
I want this address to be divided. I am new and am stuck now.
What is the best way to write a SQL query for this.
Many thanks

View 8 Replies View Related

Dividing Creates An #Error...

Aug 29, 2007

Hello,

I am trying to do a simple division. But I am getting an #Error when Access query tries to divide 0 by 0. Here is my example:

fldOne = 0
fldTwo = 0

fldCalc: IIf(([fldOne]/[fldTwo])=0,0,([fldOne]/[fldTwo]))
result = #Error

However:

fldCalc: IIf(([fldOne]+[fldTwo])=0,0,([fldOne]/[fldTwo]))
result = 0

If I change the IIF to [0]+[0] (plus) then it works. So I think I am trying to find out how to divide two fields that both contain zeros? (...I think!)

Any help appreciated!

dj_T

View 13 Replies View Related

Forms :: Dividing Lines In Form But Not Report

Aug 12, 2014

I have a form that I'm using as a subform as well as a subreport.

I would like to have dividing lines in the subform, but not the subreport.

Is there any way of doing this other than just creating a duplicate form with a different name?

View 5 Replies View Related

Reports :: Hidden Count Box For Dividing A Set Of Values

Aug 11, 2015

I am trying to get my report to divided numbers that are there. I get this data from subreports, then want it divided by the appropriate number. Example:

23
0
10
15
0
0
this would equal 48, but I want it to be divided by 3, not by 6. Or say the next report would have:

10
10
5
0
10
10

which would equal 45 and this would be divided by 5, not by 6.I was wondering is there a way by creating a hidden box that would check each value to see what it would be divided by. Example: iff(report.hasdata, control +=1)

View 9 Replies View Related

Queries :: Dividing By Calculated Total Sum Of Two Query Columns

Oct 30, 2013

I currently have a query that pulls selected data from a table. There can be multiple rows of data, and two columns include dollar amounts and quantities. I have a total line going at the bottom so I can see the Grant Total of all the rows (for dollar amounts and quantity).

Is it possible to add a column to this query that will calculate the expression:..?

=Grand Total of Dollar Amts for selected data/Grand Total of Quantity for selected data

I tried to use a query in a query, but must have done something wrong because it just said circular reference.

View 2 Replies View Related

Compare Several Hundred Rows Against Other Rows

Nov 21, 2005

Not sure if what I want to do is possible, or at least possible the way things are set up.

I have a massive table - c. 6 million rows. It contains data along these lines:

Plan#, Item, Price, Description, Colour, Value, Location, etc.

The primary key would be Plan# + Item. Each Plan# has approximately 1,000 Items, and there is only 1 Item per Plan#. There are only a limited number of Items (c. 1500) and all or only some Items might be assigned to the Plan#. All items under each unique ID# belong together, sort of in a set. So this huge table has approx. 6,000 unique sets (based on Plan#).

To add to the confusion, Item A under Plan#1 may have different information (Price, Description, Colour, etc.) from Item A under Plan#2. I know this isn't a great way to set up data but this is what I have to work with.

Over the years it's possible that the exact same combination of Items with identical values might have been set up for multiple Plan#s. What I need to do is find any Plan#s which have the exact same combination of Item, Price, Description, etc. So if Plan#R has 200 rows and Plan#S has 201 rows, it automatically doesn't match. If Plan#R has 200 rows and so does Plan#T, all information in each record must match between the two Plan#s (with the exception obviously of Plan#).

I don't think this is possible, and if it is I am sure it's not going to be easy. So far the best I can do is to come up with finding duplicates on Item, Price, Description, etc. but that's only one record at a time and doesn't tell me if the two Plan#s match.

Any help or suggestions would be much appreciated.

Thanks!!!

View 3 Replies View Related

Top 10 Within A Few Groups

Jun 27, 2007

I have a query that returns the following values:

Group_Name
Group_Priority
Person_Name
Amt_From
Amt_To
Branch
ID_Number

How can I select from this to get the top 10 'Amt_From' values within each Group_Name, in one query?

I can get the top 10 overall, and I can find the top 10 by specifiying a Group_Name value, but I'm hoping to find all in one query.

Any ideas gratefully received.

View 3 Replies View Related

Groups And Users!

Jun 30, 2005

I think I am missing sth here, after I set my new group then I create my new user, then what! How can I specify which user to login with? Will the user be promoted for a username and a password?

View 3 Replies View Related

FE / BE Security Groups

Jul 26, 2007

For a little light relief I thought I would delve into the joys of security groups and immersed in searches and reading material. From what I have learnt so far, yes FE / BE best approach and take time, as obviously easy to get wrong and difficult to undo.

Not looking for the answer, just a hint that I'm on the right track

The FE groups settings is where the bulk of the detailed work is required?
The BE groups settings are to ensure the correct read / write access to the tables?
I am thinking of making FE groups as BE users (smart or dumb) to simplify this end?

Any encouragement / early warnings appreciated

View 14 Replies View Related

Splitting Into Age Groups

Nov 29, 2006

Hi,

I have a dataset with an age field which just stored an age. I want to run a query which will calculate the frequency based on all age groups 20-30,30-40.

Does anyone have any ideas

View 3 Replies View Related

Numbering Groups

Jan 8, 2008

I have created a work order application, and the process is that it takes total number ordered of an item, divides it by a factor, and then prints x number of work orders, example qty ordered 300 = 5 work orders, 4@72 and 1@12, my question is, now I want to appended the work order number with a count number, example wo555-1, wo555-2 and so on, grouping on the work order number, so each work order start again at 1. I am stumped, can anyone help.

View 3 Replies View Related

Calculations On Groups

Apr 17, 2008

tblCountries -- CountryID, Country
tblAthletes -- AthletesID, FirstName, Surname, CountryID, M/F
tblSports -- SportID, Sport
tblEvents -- EventID, Event, VenueID, SportID
tblVenues -- VenueID, Venue, Location
tblMedals -- MedalID, MedalType
tblResults -- ResultID, AthleteID, MedalID, EventID

Primary Keys - Bold
Foreign Keys - Italic

This is the tables in my database, it is a database of the upcoming Beijing Olympics.
I am aiming to have a medal count for each country which is in the current database.
As it has the capabilities to expand therefore I am trying to avoid the need to create a whole new query for each country I add, also it would be preferable to be able to have all of the countries on the same report, so that I can compare the totals.
Is there some way I can count the total of each group of records (each country) for the field where 'MedalType' = "Gold", "Silver" and "Bronze". Also the calculation needs to be done before the report so that I can order by the total.
I am new to this so can answers be preferably in layman's terms.

View 4 Replies View Related

Option Groups

Jan 13, 2006

Hello Everyone.

I have a form that gets its data from a query.

There is a field in the query called "FinalisedDate" which is a date/time field. I want a button called Current that when pressed it shows all records where the FinalisedDate field is Null which is to be the default of when the form is open.. Another button called "Aged" is pressed it only shows records that have the FinalisedDate field has a value (i.e. not null). I want another button that shows All Records (i.e Current and Aged).

I hope anyone can help. I have searched the forums but did not find a similar problem that I can copy.

Regards

View 1 Replies View Related

Option Groups

Nov 23, 2004

This is a multi-faceted question may the answer to the first may help the second.
I have two option groups each with two options in each.
The first is called Frame 57 and has two options A ( the wizard assigned a value of 1) and B (assigned a value of two).
The second is called frame 58 and has two options C ( the wizard assigned a value of 1) and D (assigned a value of 2).
I have set enable on Frame 58 to No.

My aim:
If I choose A in Frame 57 then I want Frame 58 (with both options) to become enabled.
If I choose B in Frame 57 then I want Frame 58 to remain un-enabled.

When writing the code do I
Put it in the Click event of the FRAME?
and should i refer to the option groups by their name (ie: A or B) or by their assigned value (1 or 2).

This is what I have at the moment
Private Sub Frame57_Click()
If Frame.57 = 1 Then
Frame58.Enabled = True
Else
Frame58.Enabled = False
End If
End Sub

This seems to work though when I return close and re-open the form Frame 58 (even if it was chosen and enabled) is now not enabled even though the option is Frame 57 is correct and visible.

Hope this makes sense - any help appreciated

View 4 Replies View Related

Randomize Into Groups

Jan 2, 2008

Hello all,

I need to randomise participants in an Access 2000 db into four groups. Let's say these are 1, 2, 3 and 4. This in itself is not the problem. The problem is that I need to keep the numbers of participants in each group approximately equal, say to within a tolerance of 4.

Can anyone point me in the right direction please?

Thanks very much.

View 4 Replies View Related

Security Groups

Jan 13, 2008

please does anybody know how i can know inside my code what is the Group of my actual user???and what is the current user ?...

View 6 Replies View Related

Import Or Exoprt Groups

May 19, 2005

I want to import all the objects from a databse, and there are loads of object shortcuts.

Any ideas?

View 2 Replies View Related

Details And Detail Groups

Nov 16, 2006

Hello!

I have a problem figuring out a solution for following problem.

I have a database of details and their properties.
All the details have been described in one table.
As there is a need to describe groups of details I have found myself in a hard situation that needs to be resolved.
The structure of described detail groups is as follows:

Product

Detail Group1


Detail groupx etc.

Detail4

Detail groupx etc.
Detail groupx etc.




Detail1
Detail2
Detail3

Detail Group2

Detailx
Detailx


Detail groupx etc.


Detail groupx etc.





Is there a way of decribing my products in access so that there are no limits of how many groups does a product have and how many levels of groups the product have.

Thank you

View 1 Replies View Related

Sequential Numbering Within Groups

Aug 8, 2005

Hi all,

Simple question (I hope)...

Need to devise a way of updating a field with an ascending sequential number within a group of records of similar type.

e.g.

Say I have records which consists of numerous IDs and various job descriptions within the each ID

13000 Head of Maths 1
13000 School Secretary 1
13000 Head of Maths 2
13000 Head of Maths 3
13000 School Secretary 2
14000 Head of Maths 1

So in this case each 'Head of Maths' and 'School Secretary' sequentially increments until there is a new ID.

Any help appreciated.

thanks,
Alex

View 11 Replies View Related

Two Option Groups, One Won't Work

Mar 19, 2008

I'm trying to create a form for entering data for new items for a warehouse inventory. So far, I've figured everything out, but now I'm stuck.

I want to create an option group for two separate snippets of information: Whether a product is damaged or not, and whether a product is in numerical order or not.

I have created two bound option groups with option buttons, one for "Damaged?" (Yes or no) and one for "Sequential?" (Yes or no).

When I open the form, however, only the "Damaged?" buttons work. I can click either one, and it changes from yes to no and vice versa. However, the "Sequential?" options do not work. It doesn't matter which option group I try to click first, I cannot select "Yes" or "No" under "Sequential.

Any input would be greatly appreciated!! Thank you!

View 1 Replies View Related

Mailing Label Groups

Jul 21, 2005

I have a database of customers for which I want to print address labels depending on what group I have entered them in. There are about 30 different groups that they could be a member of. I have entered them in to groups by using "yes/no" fields on the customer table to indicate who is a member of which set. My problem is that I know how to indentify which group is required using sql

eg select surname,address from table where GP

where GP is one of the possible groups. I cannot however see a way of selecting the group variable from a form and entering into a query, so that I can print the required label set.

Can anyone please advise me on this or point point me in the direction of an example. I tried using a combo box on form but could not get it to pass the parameter correctly. Many thanks in advance.

Regards

Peter

View 1 Replies View Related

Percentages In Option Groups

Mar 24, 2006

Been searching for an answer to this one but still cant quite get it.

I am using an option group to subtract and add percentages on an amount in a text box. This is the code i am using but there is something wrong. My syntax is out.

Me.TechsRate = ((Me.Chargeout.Text - (Me.Option17.OptionValue /100))

I am trying to calculate 5% or 10% or 15% and so on, up to 35%

Thank you in advance

View 8 Replies View Related

Sort By Size Of Groups

May 11, 2006

Hi, as ever, am sure this is simple...

I have a field in a table which is a code. This code is used to allocate records to certain groups. I want to run a query which then returns the records, grouped by code and displayed in ORDER of the biggest group. So if there are 20 records with Code A and 15 with Code B and 67 with Code C the Code C records should come first, then B, then A.

Can anyone help???

Thanks!

A

View 4 Replies View Related







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