Update Criteria Data ONLY
Jun 22, 2005
Hi all,
I've tried searching the forum, but no luck.
I have a Field say Field1, with data like this:
AB, AC
AB
AC
AB, AD
AA, AB
Where the field contains "AB", I want to replace the data with say "AB - Alpha Beta". But I do not want to change any of the other data. So the outcome should look like:
AB - Alpha Beta, AC
AB - Alpha Beta
AC
AB - Alpha Beta, AD
AA, AB - Alpha Beta
I'd then go on to change AC to say "AC - Alpha Charlie".
All help appreciated,
Jempie
View Replies
ADVERTISEMENT
Jul 25, 2013
I have an update query for tGLCashAccount where it adds a value from another table with the BeginningBalance to arrive at CurrentBalance.
Here's what it looks like in design view:
Field: CurrentBalance
Table: tGLCashAcct
Update to: [tMakeNewCashBal].[TotalPrice]+[tGLCashAcct].[BeginningBalance]
Here is SQL code:
UPDATE tGLCashAcct, tMakeNewCashBal SET tGLCashAcct.CurrentBalance = [tMakeNewCashBal].[TotalPrice]+[tGLCashAcct].[BeginningBalance]
WHERE (((tGLCashAcct.GLCashAcctID)="102"));
I get the error: data type mismatch in criteria expression when I run it.
View 3 Replies
View Related
Nov 29, 2006
Ok, i have a question about update queries.I have two tables (I'll call table 1 and table two for simplicity) and an update query. I want to get some data from table one to table two (via an update query). But in table two there is a field that isn't in table one but i want to add a value to that field via the query.My question is, can i manually put into the query what data to add to a field instead of/aswell as using data from other tables.I hope you understood my questions.Cheers
View 3 Replies
View Related
Aug 20, 2007
I have data for hundreds of stores. The data was pulled for the top 15 items by store, so I cannot obtain only the top 5 items that I need. How can I query this data to extract only the top (or bottom) 5 Subjects, by store, based on the percentage column?
StoreSubjectSalesSales %
1516Fiction56431.5-24.15%
1516Audio Unabridged1650.8-231.04%
1516History / Military History10081.1-29.99%
1516Role Playing / Graphic Novels14773.9-20.27%
1516Mystery13152.6-19.84%
1516Audio Abridged1785.9-141.84%
1516SciFi / Fantasy27535.3-7.93%
1516Juv Audio/Video1580.6-100.13%
1516Biography8103.6-15.89%
1516Sports7910.8-15.64%
1516Current Affairs / Law8141.9-14.34%
1516Reference7183-16.22%
1516Juv Non-Bk4585.9-25.02%
1516Science / Tech2961.4-33.98%
1516Movies / TV / Music / Dance3395.3-29.46%
1872Fiction307344.3-7.49%
1872Business134307.5-13.48%
1872Psych / Self Improvement100650.4-10.05%
1872Audio Unabridged29165.9-27.32%
1872Cookbooks57463.3-13.56%
1872Computers59235.7-12.37%
1872Regional59883.4-11.22%
1872Health & Fitness64713.8-10.29%
1872Maps19358.4-27.66%
1872Current Affairs / Law47927.1-11.08%
1872Travel Foreign42583.7-12.27%
1872Religion / Bibles80255.6-6.07%
1872SciFi / Fantasy67641.4-6.49%
1872Study Aids / Notes38299-11.24%
1872Games41745.1-9.79%
View 2 Replies
View Related
Apr 13, 2013
My membership database has worked fine until recently. Now I cannot save inserted data. On attempted saving "Update or CancelUpdate without AddNew or Edit" appears.
The problem. relates to 2 tables Member and Addresses. PK in the parent table Member is ID. In the Addresses Table the FK is ID. There is a One to One relation between the tables and Referential Integrity is set. I know 1 to 1 is not good but it worked fine in this small database.
Browsing the all of the existing records is fine.
View 9 Replies
View Related
Jan 28, 2008
All -
I have an update query built that checks to see if a date is entered for when a document is mailed as well as a date for when that document was received.
I'm trying to setup this query to check and ensure that if multiple documents (Form8) were mailed that each one was marked as having a received date before the Update query add's a "Graduated" mark to the student. Screenshots are attached.
Anyone have any idea on how I can set this up?
Basically the tblFormEight can have multiple entries assocaited with each EnrollmentID (aka Student enrolled in a class) which represents multiple Form's set out in the mail. I don't want this Update query to run unless all entries for each EnrollmentID have Received Dates.
Thanks!
View 11 Replies
View Related
Jan 28, 2008
All -
I have another update query that is basically looking at all of the Enrollment ID's that are associated with a ClassID. If each EnrollmendID has a Graduation date and the Graduated check = yes, then I want to place the current date in the Closed Date field for the Class.
I can get a select Query that shows all of the classes and all of the EnrollmentID's but I'm not sure how to tell the query, "For Each ClassID, If All EnrollmentID's have a Graduated Date and Graduated = Yes, Then Class Closed Date = Date()"
View 1 Replies
View Related
Mar 31, 2006
What I want to do is from several records find the Max() date and update that one record with my stuff. However, I get an error message cannot use aggregate in update query or something to do that effect. Is there a way to get around this?
View 1 Replies
View Related
Mar 2, 2007
Hello, i was wondering if you could help.
I want to run an update query, taht updates prices in a table. But i would like to be able to choose the criteria when the query runs, for example a message box appears, that will allow me to enter a certain amount for the prices to change by. Could someone guide me on how to do this? thankyou, its much appreciated
View 3 Replies
View Related
Apr 15, 2008
hi all,
I'm newbie here. please forgive me if I make mistake / wrong "room"
here what I need. I want to make update query in access 2000/2003. let say I want to update field "COST" to "0", which have condition field "ID" is 070.... (070. and something). the matter is type of field ID is numeric not string, so I can't use LIKE function. any suggest what I can do without change data type for field "ID" for permanent (I mean, if we can change data type for temporary with code, and turn it back with code too, that's no problem). I don't care, either use macro or update query (if update query can't do this task).
thanks before
View 12 Replies
View Related
Jan 12, 2007
Hello,
Was wondering if there is a way without building individual update queries, to update info in one field that has multiple criteria ?
Basically I need to change/update daily multiple ID numbers to new ID numbers, long story on why this needs to be done but for now I need to do it this way.
Example: 12345 update to ABCDE, 6789 update to FGHI, etc. These ID's are all within the same field in the table.
It works fine running each ID one at a time but was wondering if it is possible to do all these updates within one query or code ?
Thanks for any assistance
View 6 Replies
View Related
Jan 31, 2014
Is it possible in Access 2010 to have an after update that if a criteria text is met, then a checkbox with the text "completed" appears next to it?
Private Sub Text45 ()
If Me.Text45 = "Test" THEN ...
View 3 Replies
View Related
Apr 4, 2013
I am designing an update query for a specific field in my table
There are 3 fields: PROVIDER_GROUP, MEDI_CAL_IND, MEMBER_LOW_CAT
I want to update the value of "Y" in the MEDI_CAL_IND field to "N" if:
the medi_cal_ind value is "Y" AND the PROVIDER_GROUP is "Medicare_Part_D"
OR
the medi-cal_ind value is "Y" AND the MEMBER_LOW_CAT is "Commercial"
A screenshot of the table is attached.
View 5 Replies
View Related
Mar 20, 2015
I am developing a Task database.
Table: TaskT
Fields include; Description, Action, DueDate, Priority, Precinct, Recurring and Employee.
Query: TaskQ
Form: TaskF and TasklistF
The forms are fed by the TaskQ query.I have sort and filter on all fields except date field which i would like to have 3 buttons which will dynamically update the criteria in the TaskQ DueDate field. Is that possible or the way to do it??
The buttons would include 'Due today' 'Overdue' 'Next 7 days' and they update the criteria in the TaskQ query and hence filter with the following;
Date()
<Date()
Between Date () And Date()+6
View 7 Replies
View Related
Jan 10, 2013
I have a form that run a query to select all the students taught by a given faculty member. Once the records are loaded, the faculty enters attendance data, selects a date from a combo box and hits a save button.I change my relationship and now need to be able to store the key for the field in the combobox and not the text.
How do I set the field, table and criteria in the update query to do this. The UD query uses the FacultyStudents query as its record source. Currently the FacultyStudents querry does not have the Key or the date fields since the date is selected by the faculty once their records are loaded. As I see it there is now way to make a join, so I think I either need VBA or SQL, which I am not very good (really bad) at wriitng. Can the necessary Sql be written in the query design view?
View 4 Replies
View Related
Aug 12, 2015
How can i update fields of one table with update query where creteria are more than one 1
Example:
DoCmd.RunSQL "UPDATE Salary2009toUpdate SET " & Me.Combo2 & "='" & Me.Text4 & "'
Where Empid='" & Me.Combo0 & "'" and where bank='" & Bankname & "'"
What is the syntax error ...
View 5 Replies
View Related
Apr 21, 2013
I need to update the periodtype field in my table depending on different values in the field Formtype- I am looking to do this without having to use VBA. I have the following fields in a table - I want to update the value of the field Period_type as follows -
When Formtype is 10-Q, update Periodtype to "Quarterly"
When Formtype is 10-K, update Periodtype to "Annual"
The current value of Periodtype for both formtypes is "Semiannual"
Can I do this using only update query?
View 2 Replies
View Related
May 30, 2015
I Have a forms which brings up a record in textboxes when you hit a search Button using a value that you type into a Textbox called BarTxt. My problem is that this value may not be unique. Therefore I'm trying to find and update the table using 2 values from the table (Barcode and PurchaseOrder).I have entered the code
Code:
Private Sub SearchBtn_Click()
PNTxt = DLookup("PartNumber", "BookInTable", "BarCode ='" & [BarTxt] & "'" And "PurchaseOrder ='" & [POTxt] & "'")
End Sub
This however is just bringing up a Type mismatch error. Even though both are text fields.Also even if I just use Barcode to search which works. My update Code
Code:
DoCmd.RunSQL "Update BookInTable SET DateBookedOut = '" & Me!DateTxt & "' WHERE BarCode ='" & [BarTxt] & "'" AND PurchaseOrder ='" & [POTxt] &
I get an Compile error saying "expected expression".
View 3 Replies
View Related
Jul 17, 2013
I'm trying to update a record in a table, from a query that is run as part of an event from a command button on a form.
I have a table called 'Assets', a table called 'Disposals', and a form called 'Disposal Entry'. I would like the user to select an Asset ID from a combobox on the form, then when the button is clicked it adds a record to the 'Disposals' table, and updates the Status for that specific Asset in the 'Assets' table to "Disposed".
It adds to the Disposal table fine, but I can't get it to update the Asset table.
My query looks like:
Field: Status Asset ID
Table: Assets Assets
Update To: "Disposed"
Criteria: [Forms]![Disposals Entry]![Asset ID]
I've checked the spelling and everything looks ok.
The [Asset ID] control on the form is bound to the Assets table. If I edit the control and clear out what is in Control Source, then it updates the table and works fine.
However, I want to keep it bound as I have a subform on my home page showing the latest disposals.
How I can get the query to use the Asset ID on the form as the Criteria?
View 14 Replies
View Related
Oct 18, 2013
I have 2 tables that must be involved in this query. Both have the same fields; one is a temporary table created from an Excel import which will be deleted later, the other is the permanent table.
tblStoreProducts is the permanent table. It has a 2-field Unique index; there can only be 1 of any ProductKey for a StoreKey (there can be multiple ProductKeys within a StoreKey, and multiple StoreKeys for each product, but there can only be 1 entry for each unique combination of ProductKey/StoreKey).
tblImportToStoreProducts is the temporary table. It holds all of the ProductKeys for one StoreKey.
My query needs to identify any ProductKey in the tblStoreProducts that does not exist in the tblImportToStoreProducts for that StoreKey, and then it must set the MaxUnits field to 0.
Basically, the temporary table is this years' inventory for a particular store. If a product was in that store last year but it isn't there this year, the quantity must be set to 0 because the ultimate aim is reporting hazardous materials.
View 1 Replies
View Related
Mar 17, 2012
I have a form, which i use to book in products received. What i want to do is if the quantity received is equal to what was ordered then i'd like to update a yes/no field (Order Complete) on a separate table to true.
View 8 Replies
View Related
Aug 5, 2005
I am trying to create a tax report for my business and am not very familiar with Access beyong making basic reports from a single table and query.
Here's the problem:
I want to report total costs for my unsold inventory purchased and worked on prior to 2005. From that I want to be able to subtract the total costs of sold inventory purchased and worked on prior to 2005. Yes, all in one report. Is this even possible?
My report contains these columns from a single table-
inventory #, purchase date, cost, sold or unsold (yes or no check box), 3 columns of additional costs and 3 columns of cost dates. Also a couple other confusing columns of costs that were split between myself and co-purchasers. These include a column of negative costs, the date paid, the balance paid to the co-purchaser, and the date of the balance paid.
I have been sorting by purchase date prior to 2005 and unsold.
The problem is I have no idea how to include the values of the sold inventory in with this report of all the unsold inventory costs without creating a massive report with all my inventory from which I can not sum the columns properly.
The other problem is that when I sort by purchase date I get cost dates from after 2005. I can limit the criteria for one of the date columns, but not all.
My questions are:
How do I included both sold and unsold inventory information in a report and sort by inventory # without simply listing all the information together in one column by inventory #? Can I do the calcualtions I want to do in one report?
How can I limit all of the date columns to show only before 2005? If I make each of the date columns with criteria AND >#12/31/2004#, they limit down to only a few records because many of the date fields in my database are empty. If I use the OR criteria it doesn't work.
I actually have many other questions but I suppose those are the biggest ones.
I know that this is a very specific topic, so if anyone has suggestions as to great resources for Access help (ie. books, tutorials, etc.) particularly with creating tax or inventory reports from a single table, that would be extremely helpful.
Anything would be extremely helpful!! I'm sunk.
View 1 Replies
View Related
Jul 1, 2005
Im looking for something that filters information for 6 months prior to any current, non-specific date. Like it will automatically get the data dated from 6 months ago from june, july, or august, without anyone having to go in an change the date criteria.
Below is a non working example of what I am trying to come up with. If I could get something like this, it would save me a ton of time going back and updating all the date criteria for my databases.
Forgot to post it:
>=Now()-Day(180)
View 1 Replies
View Related
Jul 11, 2005
I'm having trouble creating a query.
I work for a company which have a load of cd's which i've put into a database.
the database consists of a table which lists the contents, date created, department etc.
I've created a form where users can select (using combo box's) criteria to search the database.
It works well if the user selects relevant data from each combo box but i have now added a "select all" function to each combo box incase the user doesn't know the specific criteria.
This is where the trouble starts. I cant work out how to create the query so that if the combo box is on "select all" how it will show all records for that particular field.
I have tried to use an IIF function for each field in the query but i always get errors.
Please help.
View 1 Replies
View Related
Sep 14, 2007
Cannot seem to find an answer to this, but please point me in the correct way if you know of one!
Quite simple i think, but blank mind at moment!
How would i use the values in a table/query as the criteria for another query? I believed i could type in [qryOne]![classification] in the criteria box, but this does not seem to work.
Thanks in advance,
Emily
View 5 Replies
View Related
Nov 5, 2007
Hi
I am trying to set up a number of queries to return completed jobs with a specified time frame, usually monthly. So rather than have to type the same dates in arround 20 times I tried to use the data from a table in the Criteria. This did not work any suggestion would be much appreciated.
Attached is a screen shot showing a fragment of the query and the dilog box I get when it runs.
Thanks Marcus
View 3 Replies
View Related