473,480 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trouble working with not between

I have a database setup with street names and valid address ranges
(tbl_segme). In another table, I have customer addresses (tbl_unpub).
I
want to compare the addresses of the customers to ensure my street
ranges are
correct. Each table has a text_id value that associates each unique
street
name to a number. For example, Cherry Street may have text_id 1904,
Main
Street a text_id of 8894, and so on. tbl_segme has address ranges
broken out
into FRL, TOL, FRR, TOR. Those represent valid ranges From Left - To
Left,
From Right - To Right.


In tbl_unpub, I have the following records:
1 WINDMILL LN
23 WINDMILL LN
154 WINDMILL LN
177 WINDMILL LN

In tbl_segme, I have 4 records for WINDMILL LN with the following
ranges:
FRL value of 28, TOL value of 68, FRR value of 23, TOR value of 69
FRL value of 72, TOL value of 112, FRR value of 87, TOR value of 107
FRL value of 118, TOL value of 118, FRR value of 121, TOR value of 121
FRL value of 131, TOL value of 185, FRR value of 140, TOR value of 186

Text_id values are equal for tbl_unpub and tbl_segme.

According to those entries in tbl_segme, I should only have 1 row in my
tbl_temp for 1 WINDMILL LN. However, when I run the query below, I end
up
will all 4 records from tbl_unpub.

SELECT DISTINCTROW TBL_UNPUB.*, TBL_UNPUB.addr INTO TEMP_TBL3
FROM TBL_UNPUB INNER JOIN tbl_segme ON TBL_UNPUB.text_id =
tbl_segme.TEXT_ID
WHERE (((TBL_UNPUB.addr) Not Between ([tbl_segme].[frl]) And
([tbl_segme].[tol]) And (TBL_UNPUB.addr) Not Between
([tbl_segme].[frr]) And
([tbl_segme].[tor])) AND ((TBL_UNPUB.MUN)=([tbl_segme].[munl])));

Any ideas? If you need further info about the schema, let me know.

Thanks for your time and consideration!
Todd W

Nov 13 '05 #1
3 1683
Seems to me you almost have to break out the *number* of the address
from the street name. Then this should be easy - or at least
significantly easier, because you can do something like

STREETName='MAIN STREET'
AND StreetNumber BETWEEN 10 and 50;

Nov 13 '05 #2
Thanks for the reply.

The address number is in a separate column, tbl_unpub.addr.

I should have mentioned that tbl_unpub.addr, tbl_segme.frr,
tbl_segme.tor, tbl_segme.frl, and tbl_segme.tol are all integers. So
the numeric comparisons should be possible.

I was careful to exclude street names (text) from this query because of
the headaches involved with finding equal values.

Thanks for taking a look, though. It's appreciated!

Todd W

Nov 13 '05 #3
Try using SELECT DISTINCT instead of SELECT DISTINCTROW.

Nov 13 '05 #4

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

Similar topics

0
1061
by: Chris Lieb | last post by:
I am working on redesigning my site, but am having trouble getting the basic layout to render the way I envision it. I am trying to get a layout that is shaped like a U turned so the open end is...
27
1897
by: ncf | last post by:
Hi all. In another topic, I was informed that I had to dynamically allocate memory instead of just trying to expand on a list. (I'm trying to learn C, and have a strong background in PHP and...
16
1329
by: scorpion53061 | last post by:
Well as some of you know I was using a tab control for a project I was building for my boss. Today he tells me that he wants: When he switches tabs to be able to switch back and see whatever...
1
1625
by: Westbrook, Christopher L (WESTBCL04) | last post by:
I am having some trouble, and I can't figure out why. I'm trying to use the simple keylogger project from source forge, and then create a web interface to open the resulting files, so people from...
59
7422
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
3
7137
by: weston | last post by:
I'm making a foray into trying to create custom vertical scrollbars and sliders, and thought I had a basic idea how to do it, but seem to be having some trouble with the implementation. My...
9
1982
by: =?Utf-8?B?Sm9obiBCYWlsZXk=?= | last post by:
I have a ASP .Net page that allows moving around items on the page through javascript. This page works fine in IE. In FireFox however, I have found that if the page is using XHTML 1.0...
7
2271
by: Naive Programmer | last post by:
Hi, I need some simple help. First, I should apologize: I am a total programming fool in C++ and am trying to get some basic structs working before I attempt classes. I can't seem to get the...
0
1644
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7050
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,...
0
7091
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...
1
6743
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...
1
4787
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...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
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 ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.