Selecting Multiple Postcodes From Table
Aug 15, 2006
This must be the easiest of things, but I haven't used access in a while in now in my new job I need to run the following query.
I have to select a number of postcodes from a single table to see how many are in there. For example select postcodes beginning with B, CV, DY, HR, ST, TF, WR, WS, WW. Then I need to write down how many records found with the above postcodes.
Also I may have to omit some too like omit CV12
Thank you in advance
View Replies
ADVERTISEMENT
Nov 17, 2004
Hi,
I have 13 tables in all. 2 are Area and Scope which have unique entries of areas and scope and the remaining 11 will have a primary key, Tag_No.
I want to select data from these 11 tables such that ALL the data will be pulled out but say table 1 has a column MOC and remaining 10 tables dont, then it will be a blank or null in those columns for the 10 tables. How can this be done? (I hope I am not confusing!!!)
Adwait
View 3 Replies
View Related
Mar 7, 2006
I have a database with 3000 + records all with customers from all over the UK.
The CUSTOMER table contains
>customer ID
>name
>address
>postcode
I have been asked to produce reports from the database.
These reports should group all customers into postcodes regions and then display information accordingly. E.g how many customers have ordered information in region 1.
For each region I have been give a list of postcodes.
Region 1, e.g LS17, LS18
Region 2 e.g BD4 0,
Region 3 ETC
Region 4 ETC
Each region list is extremely long to type in but I have a copy on paper.
Could someone help and guide me into a quick way of grouping the required postcodes into regions 2 enable the reports to be produced.
One way I have done this is by doing a select query and typing in the criteria “like “LS1*” or like LS18*” …and by typing this on and on to the list this is quite long.
Plus I need to be able to use the * function so I select the correct postcodes.
As this is so time consuming ..Bearing this in mind I have been told a far better approach is to put the postcodes in a table and then perform a lookup on that table when trying to determine the region.
I don’t understand what to do…would this be a better approach if so how would I do this as I don’t know how to use lookup? Could someone help me? Perhaps with a small example so I could follow it? :(
Appreciate any help
Many thanks
View 12 Replies
View Related
Mar 13, 2006
I have a database with 3000 + records all with customers from all over the UK.
The CUSTOMER table contains
>customer ID
>name
>address
>postcode
I have been asked to produce reports from the database.
These reports should group all customers into postcodes regions and then display information accordingly. E.g how many customers have ordered information in region 1.
For each region I have been give a list of postcodes.
Region 1, e.g LS17, LS18
Region 2 e.g BD4 0,
Region 3 ETC
Region 4 ETC
Each region list is extremely long to type in but I have a copy on paper.
Could someone help and guide me into a quick way of grouping the required postcodes into regions 2 enable the reports to be produced.
One way I have done this is by doing a select query and typing in the criteria “like “LS1*” or like LS18*” …and by typing this on and on to the list this is quite long.
Plus I need to be able to use the * function so I select the correct postcodes.
As this is so time consuming ..Bearing this in mind I have been told a far better approach is to put the postcodes in a table and then perform a lookup on that table when trying to determine the region.
I don’t understand what to do…would this be a better approach if so how would I do this as I don’t know how to use lookup? Could someone help me? Perhaps with a small example so I could follow it?
Appreciate any help
Many thanks
View 9 Replies
View Related
Oct 13, 2006
Hi everyone;
I am using Access 2003 with Windows XP Pro. I have a problem with using a query and the dreaded UK Postcodes!
I have a Client table that contains a field “Client Postcode 1”, in which is entered the first part of the UK postcode i.e. AB11, WC1A, E1, EC2V, etc.
In a Candidate table here are many text fields where we enter which postcode a Candidate wants to work in, i.e. TN, CV4, EC, W, etc.
We have a separate Candidate Search form where we select a particular client (Combo box from the Client table) which then displays the Client’s Postcode 1 data i.e. the first part of the UK postcode before the space.
We have a select query that then tries to match the Client Postcode 1 with the postcode that the Candidate wants to work in from the Candidate’s table.
In this query design grid I have successfully created criteria that will match the Client Postcode 1 field to the Candidate’s postcode field – very straightforward. This, for example, will match a Client with a TN39 postcode with a Candidate who wants to work in the TN39 postcode.
In the same query design grid I have also been able to successfully match the Client Postcode 1 field to a Candidate’s Postcode field using just the first 2 letters (using Left). This matches a Candidate who wants to work anywhere in the TN postcode area (TN1, TN2 etc.) with a Client whose postcode starts with TN
However, what is stumping me is where a Client’s Post code has only 1 letter followed by numbers (E1, B2 etc) in the first part of their postcode without returning EX, BL etc. I would like the accumulated wisdom on this forum to point me in the right direction to design criteria to input into the query design grid that will match ONLY the first letter of the postcode IF the second character is a number.
Regards to all - and what an excellent site!
View 1 Replies
View Related
Jan 11, 2008
Hello everybody....
I was given a task by my boss to create an appraisal system for our department here in one of the local schools in the Philippines.
Anyway, what I created first a form from which all subjects being offered will be displayed. I did this by having a main form (bind to personal info table) and a subform that displays all the subjects (bind to subjects table). Then, the user will simply click on the appropriate rows bearings the subejct that the students wish to enrolled and when the save button is click, such will be saved into the enrol table.
My questions is, what control will I use to allow me to select multiple rows? and how will I be able to save selected rows into the enrol table?
Thanks in advance and more power...
~sirjhun
View 1 Replies
View Related
Jun 17, 2015
I have a number of short postcodes ie
S43
GU10
ME8
etc etc
I want a run query to return only first characters before the numbers ie..
S
GU
ME
View 4 Replies
View Related
Nov 23, 2006
Hello to all .
Have you got any idea ?
I have a List Box in a table and it is set to permit multiple items selection
from it .
The fact is I can select, as I wanted, multiple items from it through
the Form but when I go to the correspondent table to see the results
the selected data from the List Box isn't there .
Note all data selected from the List Box is visible trough the Form but
not the table .
Has this problem anything to do with mismatch in data type configuration on the table ?
Lots of thanks in advance
Miguel
View 1 Replies
View Related
Feb 1, 2005
Is it possible to select more than one item in a combo box? I have attached a sample of a database I am working on. I have a table called Interests and on the Bookings form, I would like to be able to select more than one interest in the Interests combo box, but I can't figure out how to do it. In databases I have seen, you simply have to hold down ctrl or shift to make multiple selections - that's what I want to do.
Can anyone help, please?
Thank you!!
View 13 Replies
View Related
Jun 15, 2006
Is it possible to have a combo box on a form and allow users to select multiple entries from the drop-down list? Thats just the tip of the iceburg. If you can, then I'll probably be asking more questions soon.
Thanks in advance.
View 2 Replies
View Related
Jan 30, 2007
hello once again
Scenario:
I currently have a form that the users can browse through listings of items for sale. While going through the records, they can mark with a checkbox of which items to include in a report to send in an email. The check box is currently part of the listings table, and i then run a query to pull items with the box checked, then put those in to a report, then they can email.
Problem:
about 5 users use this database, so if one user is selecting items that they want it's going to cause a problem for another user to select only the items he wants since it is all updating to the same table. Ex, if I select items 2 and 3 and another person selects items 4 and 5, when I click to show the report, its going to show items 2,3,4,5. Make sense?
Solution:
Since there are only 5 users, I made them all aware of this, and also created a reset selected email checkbox button, that sets the checkbox back to unchecked so the next person can select their own items and email. There has to be a better way to fault proof this, I just can't think of one. Any ideas would be greatly appreciated!
View 2 Replies
View Related
Sep 7, 2014
I have been given a list of UK postcodes, with the following format L15TG or TS14TGU.
I need to be able to match these postcodes to a list of postcodes I have stored in the database, however, my list are only UK outcodes, so L15TG is just L1 and TS14TGU is just TS14.
So I need to match the records and return the part of the string that matches i.e take L1 from L15TG.
View 5 Replies
View Related
Jul 10, 2007
hi,
i am querying a single table that contains card numbers and corresponding transaction codes (amongst other things). a single card number can have multiple transaction codes.
i want to select all card numbers that have both 0100 and 0802 transaction codes.
if i use a select query with ="0100" Or "0802"as the criteria, it returns all card numbers that have either 0100 or 0802 transaction types. if i then change the query to crosstab and group by card number, it is clear that some cards have both transaction types.
when i try to change the criteria to ="0100" And "0802" it returns nothing at all.
i'm sure the solution is something really simple - any idea what i'm doing wrong?
View 7 Replies
View Related
Nov 18, 2013
I have a form that has three checkboxes (IDDocument, DrivingLicence and Certification) on it. What the form is looking to do is based on the selection it will open a scanned document of the requested documents. There are 5 permutations that could be selected (either first on only, second one only, third one only, first and second and first and third). How do I code the IF Statement this so that the system will look at the different options and then do certain things accordingly.The code I have at the moment is:
Public Sub ProcessRequest_Click()
Dim Form1 As String
Dim Form2 As String
Path = "Staff" & Me!EmployeeName & ""
If Me!IDDocument = True And Me!DrivingLicence = False And Me!Certification = False Then
Do one thing
ElseIf Me!IDDocument = False And Me!DrivingLicence = True And Me!Certification = False Then
Do a second thing
ElseIf Me!IDDocument = False And Me!DrivingLicence = False And Me!Certification = True Then
Do a thrid thing
ElseIf Me!IDDocument = True And Me!DrivingLicence = True And Me!Certification = False Then
Do a forth thing
ElseIf Me!IDDocument = True And Me!DrivingLicence = False And Me!Certification = True Then
Do a final thing
End If
End Sub
All the bits work (the form stuff) but my IF statements are not working. It seems that access is seeing the checkboxes as null and so the IF is not working when i check box 1 and leave the other two unchecked.
View 1 Replies
View Related
Dec 29, 2013
I am trying to use a list-control on a form to let the user select multiple values. I have understood that this requires some VBA-code to step through the selections in the list, since the "multivalue-selection" is set to "Extended".
When I try to execute the code I have (found and have tried to adjust), then I get the error message "Object required". The "ListCount"-paramater always only results in a ZERO-value, when i step through the code:
Function cmdOpenQuery_Click()
On Error GoTo Err_cmdOpenQuery_Click
Dim MyDB As DAO.Database
Dim qdef As DAO.QueryDef
Dim i As Integer
Dim strSQL As String
[code]....
View 9 Replies
View Related
Nov 28, 2014
Now I have a combo box "cbo_items" and a text box "txt_selectedItems", I want to populate text field with items selected from the combo box, every time i select an item it appears in text box and to be separated with comma, so text box appears like this ( item1, item2, item3), and after finishing the whole thing the result appears in lable "lbl_result" as "total items selected: 3 items".
View 1 Replies
View Related
Oct 31, 2014
I have a query pulling data from two other queries (qry_Reports and qry_Surveys). Clients may have more than one ReportID, but only one ClientID. I need to query for only the most current ReportID (which is the larger value) for each client to find the surveys for the most recent report. How can I query for only the most recent report for each client based on the highest value of the ReportID per ClientID?
View 11 Replies
View Related
Jan 17, 2007
heya all- ive got sql max working on my table beacause i changed a field type to number and then sql selects the maxium value- but i now need to select a specific number along with its record from that same table.
This specific number will depend on whats been selected in a drop down box- but when im running the sql its comming up with this error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Could this be to do with the field- beacuse i needed to change it to numeric type as i wanted to use sql max, and what way could i get round it???
Heres my sql command that im running to get a value:
Code:sub sqlCmd( )'==SQLSTATMENT=================================set objrs = server.createobject ("ADODB.recordset")dim sqlStatmentsqlStatment = sqlStatment & "SELECT * FROM [Areas] WHERE [Area_Code] = '"& Code &"' "objRs.OPEN sqlStatment,objConn,1,3'==============================================end sub
any suggestions??
View 1 Replies
View Related
Mar 10, 2006
I have an order table and depending on the the product grp it needs to then be able to select the appropriate size scale table.
e.g.
I order suits, and select a size grade A ( there are 7 size grades ) I then then to enter the size scale for that product. I am not sure whether to create 7 differant tables with the different size grades and link that to the table, if so how do i get it select the correct table.
please help...
H
View 1 Replies
View Related
Mar 10, 2006
Selecting the correct table
--------------------------------------------------------------------------------
I have an order table and depending on the the product grp it needs to then be able to select the appropriate size scale table.
e.g.
I order suits, and select a size grade A ( there are 7 size grades ) I then then to enter the size scale for that product. I am not sure whether to create 7 differant tables with the different size grades and link that to the table, if so how do i get it select the correct table.
please help...
H
View 2 Replies
View Related
Feb 5, 2007
I have a database spread accross a number of tables, I'll simplify it a bit here - there's questions, answers, respondents each as seperate tables.
Respondents includes
RID
Name
PostCode
Questions
QID
Question
Answers
AID
QID
RID
Answer
The answer table contains answers to all the different questions.
How can I query this to compare questions ? grouping answers to spot trends in the data
So I'd want to pull out the answers for questions 1 and 2 showing someone that answered question 1 with Yes and question 2 with No.
Any help would be much appreciated, or even a point in the right direction.
I've played with Crosstabs, multiple queries and pivot tables - none seem to be able to do this.
Thanks :)
View 8 Replies
View Related
Oct 23, 2004
Hi
I want select 2 table at same time
this is my code and my first table
Code:
strSQL = "SELECT TOP "&Cint(intTopCount)& " * "
strSQL = strSQL & "FROM T_WEBLOG "
strSQL = strSQL & "WHERE b_published = true "
strSQL = strSQL & "ORDER BY b_date DESC, b_time DESC;"
the above code work very good
but I want select second table
I added this code to above code
Code:
strSQL = strSQL & "SELECT T_IMAGES.* "
strSQL = strSQL & "FROM T_IMAGES "
so this is my code
Code:
strSQL = "SELECT TOP "&Cint(intTopCount)&" * "
strSQL = strSQL & "FROM T_WEBLOG "
strSQL = strSQL & "WHERE b_published = true "
strSQL = strSQL & "ORDER BY b_date DESC, b_time DESC;"
strSQL = strSQL & "SELECT T_IMAGES.* "
strSQL = strSQL & "FROM T_IMAGES "
but after I added second code to it
I get this error
============
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Characters found after end of SQL statement.
/functions.asp, line 71
===========
whats the problem
Please help me I need it
Thanks
View 5 Replies
View Related
Apr 25, 2008
Hope this works, The table is as follows, ish
Name1 y/n1 y/n2 y/n3 y/n4 y/n5
a...........y......y....n.......n.....n
b...........n......n....y.......n.....y
c...........y......n....n.......n.....n
d...........n......n....n.......n.....y
e...........y......y....y.......n.....y
f............n......y....n.......y.....y
g...........y......y.....y......y.....y
what i need to be able to do is take a form/query answer some questions, y/n1= y/n2= y/n3= ......
Then off the back of this be able to pull out the correct item from column name1.
But i don't need an exact match on all columns. If i am only interested in y/n2=y i need to display all matches
My head says the following If y/n2=y and y/n3=y Then Name1 = e and g
or another example if y/n2=y and y/n4=y and yn5=y Then name1 = f and g
if a y appears in more columns it doesn't matter but it has to be in all those columns i am looking at
can anyone suggest the simplest way forward on this.
View 1 Replies
View Related
Apr 2, 2006
Hi All,
Any ideas on how I do the following.
I have a table with 1500 records in it.
I want to select at random 4 of these records and append them into another table along with some other data that the query will not pick up, in this case Pilot and Month.
I guess I am having to go the VBA route but dont have a clue on how to do it.
Cheers in anticipation.
Andy.
INSERT INTO Assignments ( flightcode, aircraft, depart, destin, pilotcode, [Month] )
SELECT Schedule.Flightcode, Schedule.Aircraft, Schedule.Departure, Schedule.Destination, [pilot] AS Expr1, [MONTH] AS Expr2
FROM Schedule
WHERE (((Schedule.Departure) Like "man*"));
View 3 Replies
View Related
May 9, 2005
Here's my problem:
I got a Table which contains software:
TblSoft:
ID |Software
-------------
1 |Office
2 |Winzip
3 |Etc.
I made a form with a dropdown-menu in which I can select the software and it stores it in another Table named TblPC.
It stores something allright. but not the text. It stores the ID Nr.
How do I get this to work that it puts the text inside the table instead off te ID nr?
I allready tried changing the properties off the listbox but it wouldn't help.
View 2 Replies
View Related
Jul 19, 2006
in tblquery i have a field date.
it its formated to =Date()
i also have two more fields
1- month
2- year.
what i want is to extract the month and year from the date field.
but the thing is, i was it to be visiable when you are in the table "view".
but i dont know how to format this.
View 9 Replies
View Related