Replacing Repeated Values From Recrods?

Mar 4, 2007

Attaching a sample mdb file. I have TABLE1, TABLE2 and QUERY1, QUERY2 in my mdb file.

I want Query1 Value 4 once in Query2. It should not be repeated again with [SBNO] values 5 time.

Value 4 in Query 2 shows with only 1st record and remaing 5 records shows 0 value instead of 4.

How is it possible.? Can anyone help me.

View Replies


ADVERTISEMENT

Replacing The Numeric Values Of A Field In Querry

Apr 25, 2007

Hi

I am trying to replace the numeric values of a field with a text in querry using Choose function, something like this aa5:

Choose([a5]-1="one";[a5]-2="two";[a5]-3="three";[a5]-4="four")

But it is not giving me no results :(( I am missing something but I do not what. Maybe I should use some other function?

I hope someone will help me!

View 1 Replies View Related

Replacing Null Values In Text Fields

Sep 10, 2007

Hi,

i have created a query from just one table, which is basically a list of Financial transactions.

There is a field called supplier code, in this query.

Most of the transactions have a supplier code, but there are a few that don't.

i've got another table that has the supplier name against the supplier code.

i want to bring this table into the query, so that i can show the supplier names against those records in the query that have a supplier code.

when i add this table and link the 2 tables up and put the supplier name into the query. The query excludes the records with no supplier code.

This is presumably, because they contain null values.

I've been reading about the Nz function and i think this is what i need to use.

i've tried this, but it still only brings through the records with a supplier code and not all of them.

How i've done this is to go into the design mode of the query and in the column that would have null values i have click "build"

in here i have the following formula.

Nz([Supplier Name],"No")

Am i doing anything wrong?

View 2 Replies View Related

Replacing Date Values For Last Friday In Month

Apr 30, 2008

Is it possible to create the following logic in query:

"If there is a "SHIFT2" or "SHIFT3" value on the last Friday in month,
then change the date values for these entries to the next date (Saturday)"

In the attached sample, there is a number of such values within the "Adv Track Shift" field dated on Friday 04/25/08 in the "shift_date" field. The logic should replace the applicable dates to Saturday 04/26/08. This should work for any month, regardless if it finds either of the two shifts or both of them.

View 4 Replies View Related

Queries :: Combining Columns And Replacing Certain Values

Sep 29, 2014

I need to create a query that combines two columns (lets say Column A and Column B for example) however the problem is that whatever non-null values that are in Column B must replace any value in Column A. If Column B has a value that is null then Column A's value is shown.

I have an example of what I'm working with (access file) and what result I want (excel file).

View 2 Replies View Related

Counting Repeated Data

Oct 11, 2007

I have qrys that show current info and also repeated info. A request has been brought to me to now count how many times the repeated data has been repeated.

The data is updated daily, so the repeated record would need to increase in the number of it's occurances by 1 each day.

Any guidance on how to accomplish this is GREATLY appreciated! :)

View 5 Replies View Related

30 Cap Limit On Repeated Forms?

Jan 16, 2006

when i change a form so that instead of single form its multiple forms it seems to only want display 30 instead of the 62 that exist. is there a quick fix this?

if not is there a way to make it display the next 30?

as now it says "record 30 of 62" when it gets to the bottom of the form... ;/

any help is much appreaciated ta. <3

View 3 Replies View Related

Select One Record For Each Repeated Entry

Mar 6, 2006

Hello All,
In my table, I have some records that are duplicated (aside from the primary key).
How can I select only one record from each set of duplicated entries? (There may be more than 2 of each of the duplicated records, but I only need to pull one of them...doesn't matter which one.)

i.e...Like a 'Find Duplicates' query, but only returning the top 1 primary key from each duplicated set.

Thanks,
Sarge.

View 2 Replies View Related

Query Returning 3 Repeated Records Per ID?

Mar 15, 2006

I am trying to build a query which will find the costs from a set of tables where the client has costs.

The client has a cost on booking a fee, he has a hotel room cost and a room facility cost.

My query brings up what I want but each result is repeated 3 times.

I don't know why, can someone correct me please.

SELECT DISTINCT Addresses.ID, Holiday_Bookings.Initial_Cost, Room_Facilities.Cost, Rooms.BasicCostPerNight
FROM ((Room_Facilities INNER JOIN ((Hotels INNER JOIN Rooms ON Hotels.HotelID = Rooms.HotelID) INNER JOIN Stops ON Hotels.HotelID = Stops.HotelID) ON Room_Facilities.FacilityID = Rooms.FacilityID) INNER JOIN (Routes INNER JOIN WalkTypes ON Routes.RouteID = WalkTypes.RouteID) ON Stops.StopID = Routes.Arrive_In) INNER JOIN (Holiday_Bookings INNER JOIN (Groups INNER JOIN (Clients INNER JOIN Addresses ON Clients.ID = Addresses.ID) ON Groups.ID = Clients.GroupID) ON Holiday_Bookings.ID = Clients.ClientID) ON WalkTypes.Walk_TypeID = Groups.GroupID;

View 3 Replies View Related

Can I Use A Query To Show Only One Of Each Repeated Data

Nov 7, 2007

I am really new to using access and I have a massive table 16000 or more entries. What I need to do is take this example data :

VPIAddress
001:99_97_AO
001:99_96_AO
001:99_0_AI
001:986_51_CI
001:986_50_CI
001:985_51_CI
001:985_50_CI
001:984_50_CI
001:983_51_CI
001:983_50_CI

(This is just a tiny fragment of the total data)

The 001: to the first '_' is the important bit this is defining a "Router" what I need to do is total up how many '001:*_' there are, not including duplicate numbers.

Firstly if I understood this (http://www.access-programmers.co.uk/forums/showthread.php?t=92001) post correctly I need to have all the VPIAddress the same. If this is correct is there a way to get access to delete the data after the first '_' ? (I would of posted in this tread but i didnt think that would be right, if im wrong mods move the post :) )

Secondly will the info in that post help me to reduce the data into this :

VPIAddress
001:99_
001:986_
001:985_
001:984_
001:983_

So that I can then see how many Physical "routers" there are

If any one can help me and tell me that my idea will work then tell me how to do it id be extremely happy!

Even if any one says that wont work and gives me the correct way to do it and does a virtual "Clip around the Head" and call me a Daft Bugga I would still be happy because I wouldn't have to trawl through the entire 16000+ entries deleting and modifying.

View 4 Replies View Related

Queries That Extract Repeated Item

Nov 14, 2007

I'm trying to set up a query where it returns me only the items that are repeated.

ie...I have a table that has clients that are one time clients and other that are repeated. Each client has a client number. I would like to get only the clients whose client number appears more than once. Is that possible?

View 1 Replies View Related

A Set Of Two Conbo Boxes Repeated In A Form

Aug 4, 2005

I have a pair of combo boxes which are n a frm and work fine.
The code is:

Private Sub cboSubjectSelector_AfterUpdate()
Me!cboOneBookSelector.Requery
Me!cboOneBookSelector.SetFocus
End Sub
Private Sub Form_Current()
Me!cboOneBookSelector.Requery
End Sub

I want the combo boxes to be repeated five more times so that the same options are given within the same form. Every time inset a copy of the same combo box get the folowing error message:

'Microsft Access can't find the macro 'requery''
I am ot sure what I need to do nrder t remove the error message. I did not create a macro called 'requery' tis part of the code above.
I have alos tried to recopy the code above and then retnamed the cbo in the form adn then modified then copied and modified the code to see if that helps - it doesn't. Any ideas - please help.

View 1 Replies View Related

SetFocus Problem With Repeated Item

Aug 17, 2006

I have a form that simply lists the items:
DEPARTMENT_NBR and DEPARTMENT_NAME

In the table: DEPARTMENT_TBL

When I edit the field DEPARTMENT_NBR and it is in error (must be between 01 and 99) I want to put out a message in a MSGBOX and SetFocus back on the DEPARTMENT_NBR.

I coded the MSGBOX with vbokonly and then DEPARTMENT_NBR.SetFocus, but after the message displays and enter is hit for the ok the cursor jumps to the DEPARTMENT_NAME on the current line. Is there a way to get the SetFocus to work properly on repeating items like this? I can never seem to get them to perform the same as they do on non-repeating items.

Thanks for your help.

HERE'S THE EXACT CODE:
If IsNumeric(DEPARTMENT_NBR) = False Then
If DEPARTMENT_NBR <> "00" Then
MsgBox "DEPARTMENT NUMBER must between 01 and 99.", vbOKOnly
DEPARTMENT_NBR.SetFocus
GoTo DEPARTMENT_NBR_EXIT
End If
End If

Also, is there a way to look at a specific item in a list like that? IE. I want to reference the 3rd row's DEPARTMENT_NBR. Thanks.

View 2 Replies View Related

Reports :: Counting Repeated Dates As 1

Jul 14, 2014

I have an activity report which has multiple entries for the same date by club members. I have managed to build the database:

2 Tables
2 Queries
2 Forms
1 Report

Which list attendance's and activities by Member and Date and Prints each one starting on a fresh page..What I wish to do is count each Club Members total days attendance. I have tried using the Totals button but I don't know enough about expressions to get it to count multiple dates as 1.

Everywhere I have looked can tell me how to count between dates, around dates, workdays in a year etc. etc. etc. but none give me multiple dates the same counted as 1.

View 14 Replies View Related

Repeated Queries And Updated Data

Sep 13, 2013

I am running repeated calculation queries of different data, but its is not working to well. I have one query listing the total number of hats made from wool. I then have a second query of that lists the total number of hats made from wool and are black. I have third query that calculates the percentage. I have many different hats of many different colors, and i am doing the same three queries over and over. However, the calculated field for percentages does not update. E.G. I have 100 wool hats, 10 wool,black hats, 10%. The next round: i have 100 wool hats, 5 wool green hats, its will still show me 10%, as its is still calculating based on the previous data. how can i go about this most efficiently and why is not updating?

View 1 Replies View Related

Combo Box List: Repeated Names Problem

Dec 11, 2004

my search form has a combo box with "make"names. i can add new makes via a other form. so the combo box needs te run via a query so that it can list new makes (so that i can also search them). but, since some makes repeat them selves in the table, sometimes up to 15 times (see atachment 1), the combo box will show 15 times the same make. i just need it to show the make 1 time, all of the makes just 1 time. only way i can do that is to type them my self (see atachment 2). but then new makes that are added later wont be shown in the list.

so: i want that the make is only shown once in the list, and that the list is updated with new makes that are added later. how do i do that?

note: a "make" E.G = Philips, Apple, LG, Microsoft, creative etc (just for the lesser skilled english readers like me )

all help is welcome

View 2 Replies View Related

Tables :: How To Break Down Repeated (Quantity Ordered) 1 Through 5

Apr 17, 2013

Right now I have a flat database with too many unnormalized fields. I am trying to figure out how to break down the repeated "QuantityOrdered" 1 through 5. "QuantityReceived" 1 through 5.

"RequestedItems" 1 through 5 and "Price" per unit 1 through 5. I'm not sure if they go into the same tables, if they are each listed 5 times and if in different tables how many instances 1 or 5 to show each as seperate and how to create a relationship between them.

View 4 Replies View Related

General :: Rewriting Repeated Blocks Of Code For Combo Boxes

May 10, 2013

I just recently started programming in MS Access. I have some forms with lots of combo boxes. I do not want users to type anything in the boxes, but to only select stuff that is contained in the drop down menus.I found this useful code and I am using it in my combo boxes on the key down event to do what I want.

Private Sub cmb_a_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode <> vbKeyTab And KeyCode <> vbKeyReturn Then KeyCode = 0
End Sub

Private Sub cmb_b_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode <> vbKeyTab And KeyCode <> vbKeyReturn Then KeyCode = 0
End Sub

Private Sub cmb_c_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode <> vbKeyTab And KeyCode <> vbKeyReturn Then KeyCode = 0
End Sub

The issue is because I have so many combo boxes, is there a better way to rewrite the code so I don't have to repeat the same code in 20 places?

View 5 Replies View Related

Handling Repeated / Mirror Records In Query As A Result Of One To Many Relationship

May 5, 2015

I have built a contacts manager based on an Outlook export (I know I can link the two programs, but I wanted to customize the contacts a bit further). I built the database in a way that phone numbers, addresses, etc. allow for multiple entries for each person under the same column using a foreign key. The only difference is a field called "Type" which designates the entry for Home, Work, etc. The issue I ran into is when I queried the data I get multiple entries for the same record. As you are all likely aware, Access repeats the data in a query for each different case. For example if Bob Jones has a personal and work phone number, Access will show the results in a query like this:

1. Bob Jones 555-555-5555 Personal
1. Bob Jones 555-222-2222 Work
2. Jerry Smith 555-111-1111 Personal

If I kept the data in Access it wouldn't necessarily be an issue. However, I want to be able to export the data in an excel file. How do I get Excel to return the data so it looks like this:

1. Bob Jones 555-555-5555 Personal 555-222-2222 Work
2. Jerry Smith 555-111-1111 Personal

View 3 Replies View Related

Queries :: Counting Records Returning Load Of Lines Of Repeated Data?

Oct 11, 2014

I have created a query that is designed to return a count of how many records there are in various tables. There are 10 expressions in all, so when it is run I am expecting to see one row of data with each field populated with the number of records.

It does do this, but the data is repeated over line after line (see the attached picture)

View 4 Replies View Related

Replacing Many Iif By Something Better

Jun 21, 2007

I have a customer who made a query with a field that looks like that:

NewField: iif(Field1=True and Field2>100 and isnull(Field3);"Blue";iif(Field1=True and Field2>100 and not isnull(Field3);"Black";iif(Field1=True and Field2=100 and isnull(Field3);"White";... And so on, for miles and miles.

Although it works, and fast enough, I don't like the way it is displayed and I am sure that it could be even faster without all these iif.

Any idea about the best way for me to handle this kind of query?
Thanks!

View 2 Replies View Related

Replacing 'Name' With 'ID' Taken From Another Table

Dec 19, 2007

I have a main table which contains data on Oilfields. This is set up with an auto number for ID and a name of each oil field. I have other tables which contain things such as Pipelines, Wells and Platforms, which are linked back the the main table.

The problem is that the database was given to me with the links being between the Oilfield_Name, and not using the Oilfield_ID (which is not present in the 'satellite' tables). How can i add the oilfield_ID column to the 'satellite' tables so i can link them properly?! (i can obvioulsy physically add an 'Oilfield_ID' column to the 'satellite field', but how do i populate it with all the correct IDs from the main table, to suit what is in the 'Name' column of the 'satellite' field- does that make sense?). I suppose I need to replace all of the Names with the IDs?

This has been giving me such a headache. The Oilfields table has 2500ish records, with as many as 1200 in the other tables linked to it.

View 7 Replies View Related

Replacing Query

May 16, 2007

hi. i are replacing queries in my tables to get the database ready to convert to SQLServer.
Am having a problem replacing a query that is brings in a table for a drop down and inserting the selection in the record.
during creation, the record shows a date, id, task, hours.
the datatable needs date, id, task_code, task_name, task_job, hours.
On "task" the drop-down allows for selection of several choices that are 3 columns wide. i can get the columns to show but only the first column currently goes in my new table. the table's columns that the selection comes from is "task_code,task_name, task_job". All columns are needed as different areas use the same task code but use different jobs or names.

I was told to use a insert into statement, however am having problems with it.

have as follows:
SQLStatement = "SELECT [Task_code], [Job_name], [Task_name] FROM tablea; "
rec.Open SQLStatement, , adOpenDynamic

job = rec(1)
task = rec(2)

rec.Close

SQLStatement = " Insert into [tableb]([Job_name],[Task_name]) " & _
" values (" & job & ", " & task & " ) "

rec2.Open SQLStatement, , adOpenDynamic

db.Execute (SQLStatement)

any point in the right direction would be greatly appreciated.

thanks,
slh

View 1 Replies View Related

Replacing Most Recent Record

Dec 11, 2007

Hi, Im building a DB that basically tracks the hours people have worked,
its all going fine apart from one major bug which i cant get my head around, I am trying to work out a way so that if someone decides to change the hours they have worked it replaces the existing record and does not create a new record.

Each record has a unique user ID attached and each day is dated, do you think this is a VBA solution or a change in the relationships perhaps?

Sorry fi there is already a similar answer to this question on the forum, but i couldnt find one!:confused:

Thanks in advance,

Paul

View 2 Replies View Related

Comparing And Replacing Data

Oct 17, 2006

Hi, I have 2 tables with similar data. However I need to compare this particular field called CompanyName in both tables. Reason being human error/exposition data errors. For example, Chef Kitchen Holdings Limited, in one table it is Chef Kitchen Holdings Ltd while the other table is Chef Kitchen Holdings Pte Limited, they both are the same but Access recognise them as 2 distinct datas.

Therefore I need help in comparing datas between these 2 tables for this particular field. So long as there is 75% similarities, one of the 2 tables will have the data replaced.

Is that possible using Access? if not, how about excel? please suggest.

thanks.

View 4 Replies View Related

Replacing Cell Value In A Table

Aug 1, 2007

OK, here is my situation. I have an access database which is updated automatically every night with new data. My companies solution to this is each morning, the entire database is downloaded to my computer to be used by another application.

In one of the tables, there is a field that doesn't work for my purposes, so each day I have to manually open the table, and change the contents of that field for every record. For example, lets say I have the following table:

Field1 Field2 Field3 Field4
Rec1 Wigets Faucet Model1A
Rec2 Wigets Faucet Model1B
Rec3 Wigets Sink Model1A
Rec4 Wigets Sink Model1B
Rec5 Wigets Toilet Model1A

Each day I manually change Field2 so it reads "Total" and whatever is in Field2:

Field1 Field2 Field3 Field4
Rec1 Total Faucets Faucet Model1A
Rec2 Total Faucets Faucet Model1B
Rec3 Total Sinks Sink Model1A
Rec4 Total Sinks Sink Model1B
Rec5 Total Toilets Toilet Model1A

Each morning when I receive the new database download, they all go back to widgets.

Is there a macro or module I can create to automatically look at Field3, and then assign a new value to Field2 based on Field3's value?

Any help would be appreciated!!!!

View 3 Replies View Related







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