Group By Using SQL In Access

Jul 30, 2014

I am using the group by function to remove duplicates based on certain fields. However, I want the Primary Key ID to also be returned .

If I add it to the select statement, I have to also add it to the Group By line which messes up the duplicates.

So...how can I just view the ID field in my return without making it part of the group by function?

View Replies


ADVERTISEMENT

Using Access's User And Group Accounts Or Using A Login Form To Access Database?

Sep 9, 2005

Using Access's User and Group Accounts or Using a Login Form to access database?

I've been researching on how to make a database secure. How to create User and Group Accounts on access, I see the step by step instructions and tried it out myself.

I also saw some sites where they give an example of a Login Form and how to create one.

My question is do you need to create both. First create the users and groups to permit or deny access to certain forms and then have a login form?

But would that mean that they'd have to login twice? Once when the database opens because it activates the db security that was created and then login again in the login form that was created?

Also when the user logins in and clicks on the cmd button on the form which opens up another from, frmWorkLog, I have an Employee field. This field I want it to have the user's name entered automatically and "locked". So that info, employee name, is extracted from the user's login. So then the user can only see his or her records only and no one elses.

How would I go about creating that. Hope I made my explanation clear.

Thanks in advance.

View 3 Replies View Related

Reports :: Sum Group Items By Specific Item And Hide Details Of Group Summing

May 29, 2015

Despite Google I can't seem to figure this out.

I have some data in a format similar to:

Name / Style / description / speed / distance
john / driver / careful / 80 / 5500
mary / driver / careful / 70 / 7000
pat / racer / reckless / 100 / 6000
anne / driver / careful / 75 / 1000
peter / racer / reckless / 110 / 6500
don / snail / slow / 60 / 6000

I want my report to total by style, without details and to look like:

driver careful 13500
racer reckless 12500
snail slow 6000

How do you get a report to sum the group items by a specific item and to hide the details of that group summing?

View 2 Replies View Related

Setting Up Group Accounts In Ms Access

Dec 7, 2005

Hi folks,

I'm new to MS Access and these group forums, and have just taken over an admin role, so please bear with me.

I'd like help with the following. Just nearly had a catastrophe with MS Access, but luckily I've managed to get it back to what it was this morning.

We have a Task Database, set up years ago, which is held on a centralised server, and each person accessing the database has a folder called C:/Task, with a Task.mdb icon, which then links to the main database. This works OK.

I also have a database on another server, which is used for logging problems, and handovers. I've set this up as a One stop shop, with a nice front view, from which I have links to all our databases, and other documents, one of which is the Task Database. This worked fine until this morning.

What I was attempting to do was to setup access to that it recognises the person logging on, and instead of saying Hello Admin, it will say Hello xxx.

I tried setting up a new multi user environment, by updating the Workgroup Administrator. I set up a new .mdw file called system.mdw, which worked on my task database, when I logged on directly.

However, when I log on via the front database, it won't open up the Task Database, as it says that the system.mdw file is in use.

Is it possible to set Access up, so that you can use logon account on more than one DB ???

I've now reset the Workgroup Administrator to point back to WINNT/system.mdw, and it now allows me to access the task db from my front db... So, I'm back to square one.

Please, please can anyone help?
Ta
Karen

View 2 Replies View Related

Does Some From The MS Access Group Monitor This Forum?

Mar 10, 2006

Surely I am not the only one who imports text files in to Access (on XP) containing double quote characters???

Does Access quit the import at the double quote character for anyone else.

To the MS Access group.. have you tried this??

Thanks

View 1 Replies View Related

Reports :: Control Group Expression For Group In Report?

Mar 28, 2013

Is there a way to have an expression in the control source of a text box in a report, that re-starts or is exclusive for every group within the report?

View 5 Replies View Related

Problem With New User In Group Access Database

Jul 25, 2007

We have added a new user, following the steps that we always follow, with no probs upto now.

He's showing in the list of users with membership of the correct groups.

However when trying to login with his username and password although it looks like it's accepting username and password as normal and database begins to open we then get the following error message

"operator has not been found call administrator"

and the database closes

Any ideas?

Many thanks

View 1 Replies View Related

Urgent: Determining SQL Server User Name & Group From Access

Oct 17, 2005

I have designed an application in Access with an SQL backend.

How do I determine the user logged into SQL from within my Access application.

Specifically what stored procedures can i use to determine
1. The user name
2. The user's group(s)

of the currently logged-in user.

I would appreciate any other techniques for solving this problem

Thanks.

Peter.
Nigeria

View 1 Replies View Related

Option Group Frames, Hidden Controls & More...Access 97

Sep 14, 2004

I'm not entirely new to Access, but I don't have the formal training or experience to accomplish what I'm attempting. And, after hours of research, I haven't been able to find anything that quite works. I know it's do-able, I just can't figure it out. Any help is much appreciated. I'm using Access 97.

In a form (MasterBadgeForm), all fields require completion. However, I want to force the user to complete 2 fields before any of the others are visible.

The 1st 2 required fields are:
- HostLastName: ComboBox (user's last name based on a simple query called HostMasterQuery)
- Visitor_Guest: Bound option group frame with option buttons "Visitor" (option value = 1) and "Guest" (option value = 2).

Note: The logic behind using an option group frame (instead of check boxes, etc.) is to force the user to choose "Visitor" or "Guest", but not both or none.

After both fields ("HostLastName" and "Visitor_Guest") are completed, I want 2 things to happen:

First: Depending on the choice selected in the Visitor_Guest option group frame, I want respective combo boxes to either be visible/available, or not. For example, if the user selects the "Visitor" option button, I want to make visible a combo box named VBadgesCombo (based on a simple query that has pre-defined "Visitor" numbers) and "hide" the combo box named GBadgesCombo. The same concept applies if the user selects the "Guest" option button.

Second: I want all the other required fields to become visible.

I've done a ton of research, but I just can't quite figure it out. Any help is much appreciated.

Donna

View 1 Replies View Related

Option Group Use Of Null In Upgraded Access 2003

Nov 5, 2004

We just upgraded from 97 to 2003. Just a few little issues.
We have an option group.....3 different toggles. One is supposed to bring up incomplete records by check if the 'end time' field is empty:

ElseIf Frame240 = 3 Then
Me.filter = " [End Time] = Null"
Me.FilterOn = True


It worked in 97 version. Nothing shows up now in the 2003 upgrade version.

Any ideas

View 2 Replies View Related

Queries :: Access 2010 - Inline Query Using Inner Join And Group By?

Nov 14, 2013

I am currently using INNER JOIN and GROUP BY to narrow down the RowSource of a combo box based on the value selected in the active combo box where the code is located "onClick".

The value being selected is a StoreID, This ID is matched against the AssetRegister to find all group names, The GroupID and GroupName are then retrieved from the AssetGroup table, then finally the list is grouped on the Group ID and Group Name.

I have tested this query in SQL Server Management Studio and it works without any issues, however when I use it as an inline query to adjust the row source of the combo box it returns no values.

Here is the SQL query:

Code:
SELECT AssetGroup.ID, AssetGroup.GroupName
FROM AssetGroup
INNER JOIN
(SELECT AssetRegister.AssetGroup, AssetRegister.Store
FROM AssetRegister
WHERE AssetRegister.Store=7) AS ar ON (ar.AssetGroup = AssetGroup.ID)
INNER JOIN Store ON Store.ID = ar.Store
GROUP BY AssetGroup.ID, AssetGroup.GroupName ORDER BY AssetGroup.GroupName

And here is the inline query applied to the RowSource:

Code:
AssetGroup.RowSource = "SELECT AssetGroup.ID, AssetGroup.GroupName FROM AssetGroup INNER JOIN " _
& "(SELECT AssetRegister.AssetGroup, AssetRegister.Store FROM AssetRegister WHERE AssetRegister.Store=" & StoreID & ") AS ar ON (ar.AssetGroup = AssetGroup.ID) " _
& "INNER JOIN Store ON Store.ID = ar.Store GROUP BY AssetGroup.ID, AssetGroup.GroupName ORDER BY AssetGroup.GroupName"
AssetGroup.Requery

View 4 Replies View Related

Reports :: Dynamically Sort Report That Already Has Group By (XP / Access 2003)

Jun 28, 2013

I must use XP/Access 2003 to solve this problem for reasons I won't get into.

I have a report with a Group by on City.

The users need to be able to sort by Coordinator within that OR by Client Name based on a selection they make on the form that opens the report.

-- I have tried to set .OrderBy

-- I have tried to set .RecordSource to different queries with order by hardcoded in them (I only have 2 sort options fortunately)

Is there a way to dynamically change the "Sorting and Grouping" defined in the report? This seems to be the only sorting that the report is responding to.

View 1 Replies View Related

Reports :: Access Report Chart Across Multiple Group Levels

Jan 22, 2015

I know how to create a chart in an access report, put it in the group header or footer and link it such that the the grouping filters the chart.

My VP wants me to create a chart that compares each invididual providers episiotomy rate (something that is done to pregnant women during delivery) to the overall divisional rate on a monthly basis.

I know how to do this with 2 charts, ie 2 different group levels. One chart goes in the date grouping level (the overall rate) and another goes in the provider grouping level (the individual provide rate).

is there a way to have this in one graph in an access report?

View 5 Replies View Related

Reports :: Reset Total Pages For Each Group In Access Report

Mar 3, 2013

I can not get my Access Report to give me a total number of pages by group. I've been able to have it give the correct page number per group but not the total number of pages in each group. I've looked at the threads and it appears that in order to get this, you must do a 2 part pass. 1st to get the page number and then to get the total papers per group.

I've used the code supplied and when I do a print preview, I get the message that it can not find the control, Me!ctlGrpPages. This is the control I created and placed in my page footer section of the report. I've also seen numerous references to the report, "Employee Sales by Country" in the Northwind database. I downloaded the database but could not find this report in the database.

View 3 Replies View Related

How To Export Access Table As Outlook Contact Group Without First Using Excel

Aug 6, 2012

I have an Access 2007 SQL database with 20 users. The DB has a list of about 3,000 email addresses that I want to export to Outlook for mass mailing. I've already got the services of an SMTP mail service that allows 1000 mails at a pop to be sent, and I've already written in the logic to separate the list into groups of 1k.

The problem I'm having is that I'm currently exporting from Access 2007 to Excel 2003 format (for some unknown reason Outlook 2007 does not directly interface with Access 2007), and then I have to manually go through the import steps within Outlook to bring the data from each 1k name group spreadsheet into a contact group for mailing.

It all works fine as it is, but it's clunky as hell. I want to automate that process, but I'm not very familiar with Outlook. I'm not even sure what the file format is for a group. Surely it must have its own format, like group1.xxx, or something. My ultimate objective is to export straight from access to the .xxx (whatever it is) format, direct it straight to the appropriate folder within Outlook and in the process eliminate the need for the more tedious steps required to import each Excel file within Outlook that I'm currently using.

View 8 Replies View Related

Forms :: Access 2007 / Option Group With Alternating Toggle Buttons

Apr 8, 2014

I have an option group with two toggle buttons. Is it possible to set up the option group such that only one toggle button is visible at any given time (i.e. the unselected option) So the group has a default value. Clicking the visible button should switch the value, hide the button (option) associated with that value and show the alternate button (option) for the alternate value?

Basically only having one visible button at any given time which toggles between the two values (but I'd like to retain it as an option group, rather than as two independent buttons, as that gives me a handy value from which to determine control sources elsewhere)

I've tried setting the visibility of the buttons from the AfterUpdate event of the option group but it doesn't work.

I know I can do this with independent buttons but was hoping there was a quick(er) and easy way to do it with an option group instead?

View 3 Replies View Related

Forms :: Option Group - Warn User When Neither Of 2 In Option Group Not Ticked?

Jul 25, 2013

I stumbled upon the Option Group function just yesterday and, happy as a clam, I created a group with 2 options in radio button style. I assigned the values to a field called Registration_Type as the 2 options are "Confirmed Registrants" and "Prospective Attendees".

[Great. That part works well. When I look at the table, a 1 or a 2 is in that field so it's great to know how to control accidental ticking of radio buttons (previous 450 records or so didn't have this option group functionality so one might easily tick one of the buttons. So one part of controlling option group I know I can handle via the table itself for now.]

The challenge is how to ensure the user always ticks one or the other ... I went back to the main table and tested the 'required entry' option for the Registration_Type field but forcing an action like this is not ideal in my mind. The usual error message vagueness for the average user is no good and I don't want to limit the user so much.

Is there a way to simply have a popup come up warning that neither radio button was ticked? Perhaps something linked to the form - i.e., maybe "after update"?? I only learned about attaching code to before and after update on controls a couple of days ago, so not sure if this would be best approach.

Just something to let the user know that nothing has been ticked in the option group as that controls in which of 2 reports the data will show up in so any record not ticked might mean a registrant being left out, which would be rather disastrous <g>.

View 1 Replies View Related

SUM And GROUP BY

Mar 12, 2007

I'm trying to create a Query. I have a field "Name" from the table "Products" and the field "Quantity" from the table "Deliveries". Currently, The same product name will appear several times with their quantities. I want to SUM all of those quantities together and only have the Product name appear once. If it's a diffrent product name, then sum all of it's quantities together etc. I'm having a tough time writing a proper formula, It either has syntax errors or produces more than one field, which I don't understand. I need a formula that I can insert into the design view of the query. This formula will also create a new data field to hold the information. Can anyone help?

p.s. Do I have to use SELECT for both Name and Quantity? Where do I insert GROUP BY? I'm so confused!! I've tried things like (SELECT Name, (SELECT SUM(Quantity) FROM Deliveries) FROM Products....by now where am I supposed to write GROUP BY???

View 5 Replies View Related

Top N Per Group

Mar 22, 2008

I know you have probably seen this a trillion times, but being new to all this, it is discouraging to say the least! Please help...

I think maybe I should upload the database, let me know.

Here are the names:

Table name: PPM Data

Fields:
Company
PPM Month
PPM Amount

There are 10 different companies, and I need top 6 months data per each Company, to eventually only show the 6 amounts. I have tried all the equations I can find. But I don't think I am doing it right. I have tried to make 10 different queries for each company and than tried to join those queries, and that just didn't work.

I have tried Allen Browne, confusing, and I have tried Acc2002 for their equations for Top N per group, I still can't make out what they are saying without the actual database to look at.

View 6 Replies View Related

Group

Sep 13, 2005

Hi,
i have a combo box that query a tabel to get the date's i chose from but she repeat the samedate if i have a 2 records with date 12-9-2005 i see 2 in the combo box ho i can join them to see only one date fron them

View 1 Replies View Related

Can't Group On Memo

Jan 18, 2006

I have a field on a table that is a memo field. I am trying to write a query to include this field but get the "Can't group on memo or OLE object. Any ideas on why and how can I query with this memo field included?

View 2 Replies View Related

Show Top 2 By Group

Feb 11, 2006

I'm trying to view the last two valuations for each property so that they can be compared. I can pull out the last valuation for each property and can pull out the top two records but not for each property, just shows me the top 2 of all records.

Any suggestions?

View 5 Replies View Related

Group Permissions

Feb 28, 2005

Hi, I have just made my maiden voyage on the good ship "Security Wizard" and the water has been a little rough but as yet I still have my sea-legs intact!

Slight problem though... I want users to be able to add data to a table but not to be able to view the whole table if they try and open it in the database window. Now I know reasonable measures would just hide the DB window but I have the threat of Data Protection Auditors looming over me becuase management "forgot" to tell me security was required and it has already been breached before I used the wizard.

Anyway, I did some research on here and I found a method whereby I can set the table so only I have permission to view/add data, then I can get users to add data via a query with permissions set to Owners.

I'm really hoping that someone will come to my rescue and tell me that there's a much easier way than that...

Please....

Anyone....

Thanks, Tom.

View 1 Replies View Related

GROUP BY Just One Criterion

Jun 11, 2005

I need to execute this query from an ASP . Net page. I'm connected to an Access 2002 DB.

SELECT tblBudget.GroupCode, tblBudget.GCDescriptioon, tblBudget.Amount
FROM tblBudget
GROUP BY tblBudget.GroupCode, tblBudget.GCDescription, tblBudget.Amount
ORDER BY tblBudget.GroupCode;

If I delete tblBudget.GCDescription and tblBudget.Amount from the "GROUP BY" instruction it does not work.

What I want to do is that in case tblBudget.GroupCode is repeated (e.g. several records with the same group code) I want to display only one line summarizing all info for the given group code.

Thank you

View 1 Replies View Related

Combining GROUP BY And SUM

Jul 3, 2005

http://www.warwickwebvisions.co.uk/MA/query.gif

The image above shows results from a query I've created. However, I need to group the results by Product Id and display a sum of the individual Product Id's. So I should have something like:


Commercial Loan Mr Steve F Cobblestone LNCLCLRE £299,491.33
Demand Deposit Mr Steve F Cobblestone DD033 £7,402.81
Demand Deposit Mr Steve F Cobblestone DD043 £3,929.78
Time Deposit Mr Steve F Cobblestone TD013 £12,195.60
Time Deposit Mr Steve F Cobblestone TD018 £961,924.12
Time Deposit Mr Steve F Cobblestone TD025 £113,483.58



Any ideas how I construct a query to display the results as per above??

View 1 Replies View Related

Group By More Than 1 Hour

Jul 25, 2005

i have a table of time and dates and a value after it inn which i want to do a query which groups these values by every 3 hours e.g

my table
12/02/2001 00:00 6
12/02/2001 01:00 4
12/02/2001 02:00 8
12/02/2001 03:00 12
12/02/2001 04:00 7
12/02/2001 05:00 6


i want the query to do this
12/02/2001 02:00 18
12/02/2001 05:00 25

i cant find anything anywahere and its use ids for a chart in which the chart wizard allows grouping by 1 hour and not by more than 1 hour any help will be much obliged

cheers

View 1 Replies View Related







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