473,569 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with Selecting Post Codes

I have a table containing names and addresses called tblNames and
constructed as below:

CREATE TABLE tblnames (
strNameReferenc e varchar(6) NOT NULL default '',
strSurname varchar(35) default NULL,
strSchool varchar(75) default NULL,
strTitle varchar(25) default NULL,
strPassword varchar(15) default NULL,
strPostCode varchar(15) default NULL,
strEmail varchar(55) default NULL,
strPasswordHint varchar(35) default NULL,
PRIMARY KEY (strNameReferen ce),
KEY strSurname (strSurname,str School,strTitle ),
KEY strPostCode (strPostCode)
) TYPE=MyISAM COMMENT='Names Table';

The UK Post Code goes on the lines of "CB7 7TS" with a space between the
two parts of the post code.

If the following SELECT statement is used:

SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30

Then MYsql returns no records but no errors either and PHPMYAdmin states
that:

"Your SQL-query has been executed successfully"

Any help will be appreciated.

Thank you.
Stephen Layton


Jul 20 '05 #1
8 1266
st************@ btinternet.REMOVESPAMcom wrote:
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason why
you would get zero rows is that you don't have a row in your table where
strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;
Jul 20 '05 #2
st************@ btinternet.REMOVESPAMcom wrote:
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason why
you would get zero rows is that you don't have a row in your table where
strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;
Jul 20 '05 #3
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton
Jul 20 '05 #4
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton
Jul 20 '05 #5
You can use TRIM() to process input (or just update ) as well and change
postal code field length to 6.
It will save memory a bit.

Khazret Sapenov
"Stephen Layton" <st*****@stephe nlayton.org> wrote in message
news:1w******** ******@stephenl ayton.org...
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton

Jul 20 '05 #6
You can use TRIM() to process input (or just update ) as well and change
postal code field length to 6.
It will save memory a bit.

Khazret Sapenov
"Stephen Layton" <st*****@stephe nlayton.org> wrote in message
news:1w******** ******@stephenl ayton.org...
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton

Jul 20 '05 #7
You can use TRIM() to process input (or just update ) as well and change
postal code field length to 6.
It will save memory a bit.

Khazret Sapenov
"Stephen Layton" <st*****@stephe nlayton.org> wrote in message
news:1w******** ******@stephenl ayton.org...
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton

Jul 20 '05 #8
You can use TRIM() to process input (or just update ) as well and change
postal code field length to 6.
It will save memory a bit.

Khazret Sapenov
"Stephen Layton" <st*****@stephe nlayton.org> wrote in message
news:1w******** ******@stephenl ayton.org...
Aggro

Many thanks for your reply following which, I have checked my Access
Code which takes the Access table and transfers it to a comma separated
text file. I've just found that it was adding a separate space in the
Post Code ... so it did not find the required field.

Thank you for your help..

In message <q%************ ***@read3.inet. fi>, Aggro
<sp**********@y ahoo.com> writes
I have a table containing names and addresses called tblNames and
constructed as below:


There is nothing wrong with the table or with the query. Only reason
why you would get zero rows is that you don't have a row in your table
where strPostCode is 'CB4 3DZ'.

I tested it like this:

# insert one test row to table
insert into tblnames values('x','x', 'x','x','x','CB 4 3DZ','x','x');

# select rows where strPostCode matches
SELECT * FROM `tblnames` WHERE strPostCode like 'CB4 3DZ' LIMIT 0, 30;


Stephen Layton

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2869
by: CaliSchmuck | last post by:
I think this is probably simple, but I'm having a problem figuring it out. I have a form that is used to enter data. I want users to be able to enter a zip code in the form, and have the city and state come up automatically. I have two tables: Table 1 (14 fields): Customer Name, Address, City, State, Zip,
3
3700
by: Dan Trowbridge | last post by:
Hi everyone, In my attempt to port code from VS 6.0 to VS.NET I had some code break along the way, mostly due to not adhereing closely to the C++ standard. This may be another instance but I can't think of a good fix, or even why it broke. The problem In one of my CFormView derived classes I have a member variable of the type...
1
1450
by: emmah | last post by:
Dear Everyone, I have a small but hopefully simple problem. Please forgive my misuse of technical terminology but I am hoping someone can provide some advise. We have a database of nearly 1.6 million UK business address (MYSQL) all with post codes (zip codes). Post codes can have either 6 or 7 digits, for example: RG28PL or TR129BM (noptice...
15
3307
by: Simon Gare | last post by:
Hi, trying to retrieve postal codes from the db but only want the query to look at the first 3 digits of the code tried using (LEFT(dbo.booking_form.COLL_POST_CODE),3) but that doesn't work. I don't want the query to count individual post codes but instead look at an area found in the first 3 digits e.g. HA0 3TD is for a particular house...
10
3343
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably the worst I ever seen. I almost cannot find anything I need, including things I
3
2999
by: cuties | last post by:
Hi all.... i'm very new to this programming language. i'm required to fulfill this task in the company i'm doing my practical. i hope i can get guide for my problem... Here is the script i already wrote but i'm having problem to move forward. my problem is : 1. how do i assign each checkbox to have equal value with the value of the...
2
1559
by: rocksoft | last post by:
Hi I am working in asp.net with C# web application, I have used visual studio 2003, i have used dropdownlist in my application to populate the data from mysql database, i have got problem while i selected the item from dropdownlist, its not selecting correct item i'm selecting from dropdownlist, i have 64 records in my table, but i tried...
0
1180
by: Satiz | last post by:
Hi All, I've a TreeView(IE Webcontrol) and a DataGrid in my VS.Net 2003 ASP.Net web form. My problem : If i select a particular node(it may be parent, child or leaf), then the corresponding values from a dataTable should be displayed in the DataGrid. I've a code-behind function for LoadGrid(), this is calling selecting a node and clicking a...
5
11629
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually click to select one of the radiobuttons to select. The default behavior of Focus() seems to also select the radiobutton, but I can't seem to...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.