| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 46586 | 2004-06-29 01:10:00 | access filter expression help | Jimmy D (2061) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 248269 | 2004-06-29 01:10:00 | hi, im an access newb and i HAVE TO use microsoft access for a computer thing im doing at school. there are a list of addresses of houses, how old they are and hot much they cost. i want to put in a filter so that it only lists the houses that are from 0>65 years old and are <220000 i cant figure out how to do it, help would be appreciated. im using microsoft access 2002 on winxp |
Jimmy D (2061) | ||
| 248270 | 2004-06-29 02:08:00 | Hi, I presume this is a form? 1. In your toolbar you will have a FilterByForm icon (looks like a funnel with a form behind it) - click this. You will see all the fields in your form. 2. In the age field enter >=0 and <66 3. In the value field enter <220000 4. Click the Apply Filter icon in the toolbar. You can also select Records|Filter|Advanced Filter/Sort and then enter your criteria in the filter query. hth hth |
parry (27) | ||
| 248271 | 2004-06-29 02:09:00 | Hi Jimmy Depending on your Access knowledge this may or may not be a really long reply. If the list is a text file or Excel file and you haven't imported it into Access yet then you need to import it by Opening Access, click blank access database to create a new database, OK, type in a name of your choice (without deleting the .mdb extension if it is showing) and select a folder location, click Create. Click File, Get External Data, Import, change the "files of type" to what it is you are trying to import (txt or xls etc) locate the file, click on it and click Import. This will invoke the import wizard and I suggest you have a play with the wizard to get it right (e.g. what to import, is the file delimited or fixed width, does the first row in the file have headings, which columns to import etc.) - you should be able to work it out. Once the list is in Access, on the left hand side of the screen, click Queries, Click New, Design View, OK. You will get a dialogue box listing the available tables, select the table that has the house data and click Add. If there are no more tables needed, click Close. If you need more tables (being a relational database) then I suuggest you RTM given the lack of space to go into it here. The table of data will now appear in the top of the screen. Double click the fields you need in your answer and they will appear in the bottom half of the screen (e.g. number, street, suburb, price, age etc.). The "criteria" section in the lowest part of the screen is where you filter the data for what you want. I'm sure you can work out the price filter but for the age of the house it will depend on whether the data stored is either the age of the house or a construction date. Assuming it is a date then the filter will look something like >="01/01/1939" (or 01/01/1940?) assuming you are using a standard NZ date format (see control panel, regional settings) which will give you all houses less than 65 years old. To get both filters working together, make sure they are on the same criteria row - this is an AND query (where you put both filters on the same row) as opposed to an OR query (where you put the filters in different criteria rows). Once you are done, click View, Datasheet view and hey presto you have your list. If it hasn't worked click View, Design View to get back to the other screen where you can revise your filters or sort the data etc. Save your query under File, Save. Good luck. |
andrew93 (249) | ||
| 248272 | 2004-06-29 03:39:00 | Sql is SELECT Price, Age FROM Table WHERE Price < 220000 AND AGE > 65; Capitals are sql operators presumes Age and Price as feild names You had the answer |
beama (111) | ||
| 248273 | 2004-06-29 03:41:00 | >WHERE Price < 220000 AND AGE > 65; should be WHERE Price < 220000 AND Age > 65; |
beama (111) | ||
| 1 | |||||