Need To Perform A "lookup And Classify" Type Query
Nov 2, 2006
First off, please be gentle with me, I am a total noob on Access/SQL/etc....
Here's what I'm trying to do.
let's say I have one table with data like this
Class range
Class ValLow ValHigh
----- ---- ----
Class1 0 50
Class2 51 65
Class3 66 77
Class4 78 90
etc.
Data to classify
Entry Val
----- ----
A 10
B 26
C 52
D 85
etc.
I want a query that returns:
Entry Class
----- -----
A Class1
B Class1
C Class2
D Class4
Now I suppose this could be done with an expression with a lot of IIF's, but there are potentially THOUSANDS of classes/ranges in my real data.
I doesn't seem that Access has the concept of a CASE statement, and even if it did, it would be a huge CASE statement.
In Excel this would be trivial using a temporary column and a Vlookup, but I have hundreds of thousands of records.
How can I create a query that will do this classification? I don't even know enough about how to do it to figure out what to google on... :(
View Replies
ADVERTISEMENT
Mar 10, 2006
Hi i really need help!
i need to be able to use "lookup", i have a set of postcodes from 3000 customers, i need to extract these and compare them to lists i have of postcodes, which make up a region. And run queries from these
e.g a customer on my database has the postcode BD21 7KK
On my list of postcodes i have on paper - WEST YORKSHIRE - BD21 7
therefore The BD21 7KK Customer falls in the West Yorkshire region.
I need to do this four 4 regions with lists i have on paper then run queries.
Can some one please provide the neccessary steps?
Or even give me an example made?
Im really stuck on this at the moment and me job depends on it ! :(
Thanks
View 1 Replies
View Related
Nov 1, 2004
Heres something I dont understand about the lookup wizard:
Ive done a lookup wizard on one of my fields, so that now the user gets a drop down list of options to choose from:
0;1;2;3;4;5;6;7;8;"NTSC";"PAL"
Ive also set "Limit to list" to yes, so that these are the only options the user can enter.
However, it will still let me change and play around with the data type settings under the general tab. I dont understand why it lets me do this. I can set the lookup to the above list, and then specify a date type of type "date", and it will allow me to do it.
Why is this the case? Which datatype should I set it to, if I have a list of values like the one above?
View 1 Replies
View Related
Jul 17, 2013
I wanted to create a field lookup with values that I specify, not on the table sheet, but on the form. User can click on a text box or combo box and can select a list of value that I specify, not values that are listed on a table but ones that I type in, in the form.
View 11 Replies
View Related
Jan 2, 2014
I want to create a Web App in Access 2013 that contains a table of client names, addresses etc, and a second table that contains order details, including client name. It would be nice to ensure that as someone adds a new order they are give a drop down menu containing existing client names, and I can see how you can do this for a brand new table using the lookup data type. But I already have an Excel spread sheet containing client names. If I import this into my Access web app to create the client table, and import the existing orders to create the order table, I then try and change the data type of the client name (in the order table) from short text to lookup, it won't let me!! (If I create an empty client table from scratch, it lets me define the company name as a lookup data type - but I can't then import from Excel into this empty table)
View 14 Replies
View Related
Jul 17, 2014
I created a table in MS Access using a Lookup & Relationship data-type. This means that my record cells call upon a particular table for values. It creates a LIST of values for that cell.When I query a particular value in this table I get every possible combination of the value. My query and code are below:
OR,
SELECT MainT.Content.Value, MainT.Source, MainT.[Entities Impacted].Value, MainT.Update,
MainT.[Divisions Impacted].Value, MainT.Announced, MainT.Effective, MainT.Stakeholders.Value,
MainT.[Ref#ID], MainT.[Issuing Agencies].Value
FROM MainT
WHERE (((MainT.Content.Value) Like "*" & [Forms]![SearchF]![ContentCB] & "*" Or (MainT.Content.Value) Is Null)
[Code] .....
This means that if I query STATES: "California", I'll get back every possible combination that exists with the name California in that particular field.The issue with this is that I'll get MULTIPLE primary key values rather than just 1. So, if one record, under STATES has California in it, but the other fields in that record have the Lookup & Relationship data-type, then every possible combination of that record will query instead of the multiple field-values form that you'll see in the table I am querying.
notice that my primary key (REF#ID) is repeated numerous times! This obviously causes problems with generating records and forms concerning information for 1 particular primary key. Is there a way around this problem other than specifying search criteria down as much as possible?! Perhaps there is some SQL code.
View 1 Replies
View Related
Apr 4, 2006
Hi there.
Does anyone know how to use an update query to copy some records from one table into another?
I have table1 which has all the contact details and what I would like to do is work out a process for importing records from an excel spreadsheet.
What I have so far is as follows:
1. In access go into the queries tab and select update query
2. Open both table1 and table2
3. Drag the fields to be updated (table1)
4. In Update to select [table2].[table2 column name]
When i run this nothing appears to happen. 0 records are appended.
Does anyone now how to go around this with another solution or should I be using other SQL methods?
All comments much appreciated
Thanks
View 1 Replies
View Related
Aug 11, 2005
Hi,
How can I edit a query in SQL view to run multiple lines of SQL?
For example I can use the GUI to create a query, then in SQL view enter the following:
DELETE
FROM Employees_copy;
which clears the Employees_copy table. Perfect. But what if I want to do this for mulitple tables in the same query eg for a second table Employees_copy_2 as well? I've tried
DELETE
FROM Employees_copy
DELETE
FROM Employees_copy_2;
which gives a syntax error, as does
DELETE
FROM Employees_copy,
DELETE
FROM Employees_copy_2;
any suggestions?
View 2 Replies
View Related
Feb 20, 2015
I'm trying to get a query to perform a calculation and round the results.
The fields that I am running the calculation and am trying to round are Data Type Number, properties Field size Single and decimal places Auto.
I have tried the built in function described in Allen Browne's site to no avail.
[URL]
I have tried rounding the individual fields and then adding result.
I have also tried rounding the result (as attached).
View 11 Replies
View Related
Feb 23, 2007
How do I get a field to calculate this formula?
I want a script to find the precise current date and from another field find a number and add it to the current date day to make current date + number = date in the future.
For example
Field: Total Nights Hired = 2
Field: Date due back = 23/02/07 + 2 = 25/02/07
I am sorry if I did not explain this well enough. I am totally new to databases but need help in my corsework. I am designing a video rental system.
Any help will be greatly appreciated.
Andy
View 7 Replies
View Related
Apr 20, 2006
I know how to do a "Like '*xyz*' " type condition in a query. How do I set up a "Not like '*xyz*' " type condition in a query?
Thanks for your help. This forum is wonderful!
View 3 Replies
View Related
Feb 27, 2006
Hi,
Is there a way i can perfrom some functions before or after the next record in the recordset is loaded. (form is set to continuous)
For instance:
If i have 5 records in my forms record source after the 1st it will msgbox "sumin" after the second msgbox "sumin" and so on?
This is the record source in the properties of the form by the way not a recordset within vba?
Thanks
k0r54
View 2 Replies
View Related
Nov 3, 2004
Hello Everyone, (where would i be without ya)
Here is what i would like to do if anyone can help
I have a table with the following columns which are currency values, along with aload of other stuff
High
Med
Low
These have been put into a form as bound text boxes, i would like to allow the user to
chose their rate, say by a button or maybe option group "i'm open to ideas"
Dependent on the choice made the rate chosen will then go into a independent text box.
After there i'm fine, the reason for this is,.. the chosen rate/independent text box will form part of a calculation
Best Regards AM
View 4 Replies
View Related
Apr 10, 2014
I'm getting an error when trying to run a report. "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again."
1.) I tried to install both the V-Tools and Rick Fisher add-ins, and neither one could be added. I got errors from both.
2.) I'm working with a small test database to create a report. Db is tiny, 1.8Mb. But I've also created a report which has several embedded subreports. Everything is based off of queries which certainly have to sort through some data.
3.) I have compacted and repaired.
View 14 Replies
View Related
Jan 27, 2006
Can someone please tell me if there is a way to perform lookups in Excel from an Access table without first exporting the data into Excel? I have a form that is being exported into Excel from a pricing tool our company uses from an outside vendor. It is important the users have the ability to perform complicated calculations and are not at all experienced in Access. There are several data sources that are well over the 65,000+ rows limited by Excel. I need to either prove or disprove whether it is possible to perform lookups between Office applications. If it is possible to lookup between applications, I would appreciate any sources known to learn how to do this. If not possible, I would like to be able to confirm that fact to my manager.
Thanks for any help that can be offered.
tschultz
View 1 Replies
View Related
Dec 20, 2004
Is it possible to create a macro in Access that opens up a word document from a shared drive? Within Access, I don't see a macro available to do this.
View 1 Replies
View Related
Mar 3, 2008
Environment: Front-end Access application developed in 2003, with back-end database in 2003. Being deployed in a mixed 2003/2007 environment. Users with Office 2007 will have to open and use the 2003 Access application without converting it to Access 2007.
Problem: When I take the Access 2003 application and open it with 2007, some forms give the following error message (whether selecting Open, Layout View, or Design View):
"There isn't enough memory to preform this operation, Please close unneeded programs and try the operation again."
The real problem is some of the most complex forms open in design view, and some of the simplest do not. There appears to be no ryhme or reason to it. Some of the forms are bound and some aren't. Some of the bound forms are bound at run-time with embedded SQL, some aren't. All query objects seems to be fine, when they are used on bound forms. Some forms have significant amounts of code behind them, some do not.
All report objects execute fine with no problems opening any view.
I can open the same file in Access 2003 and everything is fine. I've compacted and repaired the DB in Access 2003, no help when I go back to 2007.
Wondering if some references are off? But I have some really simple forms that can't be opened. I find nothing on MSDN on this.
View 14 Replies
View Related
May 30, 2006
OK, usually I can figure these things out for myself, but I'm realy stuck on this one and any help would be appreciated
background: I work in a small scale pilot production line, and we take a series of measurements for every part that we make, each of which has a unique ID. Sometimes we need to take the measurements more than once, so that the data output from the measurement system (which it can append straight to an access table) has a part ID and a measurement number, the combination of which is unique (for reasons that I won't go into it is not possible to combine them into a single field, otherwise we would do this)
problem: The measurement system can be temperamental and sometimes sends the same record more than once, and It is horribly time consuming to go through and check manually
It occured to me that we could send the measurements to table1 (where they would be stored temporarily), and write a sub to go through each record in table1 in turn, compare the part ID and measurement number to the records stored in table2 (where they would be stored permanently), and append the record to table2 only if the part ID and measurement number combo has not already been taken, before moving onto the next record in table1 and doing the same thing
The part I just can't figure out is how to go through the records in turn and compare them, I can do the append and deletion using SQL, that's not a problem.
if anyone can point in the right direction I'd be realy grateful (or tell me if I'm barking up the wrong tree completely)
regards
Bogzla
View 5 Replies
View Related
Aug 29, 2005
Hello,
I am having trouble making a command button do what I want. I have a subform within my form, but I only want it to appear when I click the button. I tried using the wizard but there is no option to open subform, only open form. Any thoughts would be greatly appreciated!
View 1 Replies
View Related
May 28, 2006
Is there a way perform CTRL+' with vba code in MsAccess 2000
Carbo
CTRL+' copies data from a field in the previous record to that field in the current record.
Resolution:
http://support.microsoft.com/?id=210236
If you receive a compile error related to DAO Recordset go to:
http://www.mvps.org/access/bugs/bugs0031.htm
View 8 Replies
View Related
Mar 1, 2015
I have my setup all complete and everything works great. Now, I have a subNavigation form within the Navigation form. Thing is, I am not sure how to go about the code for the query to pick up the Beginning and End Date to generate my report. Here is my Form setup:
frmNavigationForm (Main form) - Tabs on top.
NavigationSubform (first Navigation Form, where I have a tab called Admin)
frmAdminNav (where I have embedded under the Admin tab) - Tabs on left side.
NavigationSubform (Second Navigation form where I have a tab called "Search") I don't recall what the name. How do I find it, stupid question, I know...
frmSearch (where I am trying to pull a detailed report from date search criteria)
Here is one of the codes I have been trying to use in my Query and nothing seems to work.
Code:
Between [Forms]![frmNavigationForm]![NavigationSubform].[Form]![frmAdminNav].[Form]![frmSearch]![BeginDate] And [Forms]![frmNavigationForm]![NavigationSubform].[Form]![frmAdminNav].[Form]![frmSearch]![EndDate]
View 2 Replies
View Related
May 2, 2014
tell me that can we use functional keys F1, F2,F3,,,,,,,,,,,,,,F12 in ms access to perform commands like saving a form data , for closing form refreshing form, clear form.Or is there any way to make shortcut keys combination like[(ctrl+s)(ctrl+c) (ctrl+A)] in access to perform action like saving,closing,clearing, current form.
View 1 Replies
View Related
Sep 9, 2013
I have a text box on a form, currently it performs a dlookup for me. I want to change it so that it only performs the Dlookup if a checkbox is checked, but otherwise will display the text that's in an unbound text box.
Not 100% this is even possible, but hoping so. So far I have in the textbook:
=IIf([CHECKBOX]=0,DLookUp("TABLE","FIELD","ID = " & [Text57] & ""),[TEXTBOX])
The dlookup works fine by itself, it's just making it conditional that's causing me problems. I know it could just be a small problem with the way I've written it, or it could be a bigger thing with me not understanding the way IIF works.
View 3 Replies
View Related
Mar 14, 2013
I have a subform based on a query. That query contains a couple of calculations that end up in textboxes on the subform. The problem is that the calculations require me to enter 2 dates that are on the subform. If these are not entered before the calculation is performed I get a "Cannot update record" error message and then #error in both Lease cost and Discount Cost textboxes.
View 6 Replies
View Related
Sep 21, 2004
hi friends,
i have tried had to connect sub type tabels (Saving, Checking, Loan... they have their own ids...) with super type (Account...it has account id...) on the condition of account_type (either "S","C" or "L") attribute in ACCOUNT entity.
how to joint them??? with query or with expression??
i expect help from you.........please.
........thanks.
View 5 Replies
View Related
Jul 24, 2007
I'm wrestling with the issues; in other threads, it became apparent that because I could not know ahead of time what I will need to know about a given entity, I will use a table to enumerate attributes that is applicable for a given entity.
However, the stumper is that what if an attribute should conform to a set list of values? Since they are dynamic, I would have problem predicting what I will need to be able to lookup, and am even don't know whether I will need a one-many lookup or many-many lookup.
I thought that generic lookup table with a table listing "classes" of lookup would allow me to have one big generic lookup table while using "classes" to act like virtual tables so I can then set the query to appropriate "class" to return just right set of values.
But as I thought about it, I ran into some issues which is pulling me toward the crazy idea that I should have freestanding tables, and use a field in tblAttribute to give me the table's name so I'd know which free-standing table it points to, and have the necessary key to lookup the values within that table.
Even though my gut instincts tell me that I shouldn't be going against the conventions of database design (who the frick goes around creating free-standing lookups?!?), I'm simply not sure how I can use a generic lookup table to hold all information.
For example, suppose I was given a list of values that has its own categories. Since the former design allows only for two level (lookup and lookupclass), where am I to insert that extra level?
Furthermore, I found myself needing a set of virtual keys to reference a certain "class" of lookups for report purposes. That means I need an extra field in my lookup table than I originally anticipates. What if I find myself needing one more field that just won't fit the generic lookup table?
So does anyone have suggestions on how we would create a placeholder for a lookup table that will be made just in time?
View 4 Replies
View Related