473,795 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compare part of one field with another field

Hi,

I'm trying to compare two TITLE fields from different tables to locate
anomolies - however Table1 TITLE field contains a dot(.) after some of
the entries, however i want to remove the dot so i can compare properly
(the dot is irrelavant to my comparisons):

Record1
Table1 TITLE = MISS.
Table2 TITLE = MISS
Record2
Table1 TITLE = MISS
Table2 TITLE = MISS

The two example above are NOT anomolies even though Record1/Table1
includes a (dot) - is ther any way in the QBE window that i can compare
part of one field (without the dot) with another field?

Please help

Flick

Nov 13 '05 #1
6 2401
AP
You could use the Instr() function to determine the location of the "."
then pull the leftmost characters before the PERIOD,

=iif(InStr(1,[TITLE],".")=0,[TITLE],left([TITLE],InStr(1,[TITLE],"."))

Nov 13 '05 #2
You could branch to a function that loops through each character in the
string, rejecting the irrelevant characters (air code):

Sub Foo()
..
..
strGoodString = RemoveIrrelevan tCharacters(str BadString)
..
..
End Sub

Function RemoveIrrelevan tCharacters(val ue As String) As String
Dim strTemp as String
Dim i as Integer
For i = 1 to Len(value)
If MID(value,i,1) <> "." Then
strTemp = strTemp & Mid(value,i,1)
End If
Next
RemoveIrrelevan tCharacters = strTemp
End Function

Johnny

Nov 13 '05 #3
Would I place this in the qbe window? I'm a little unfamiliar with
Access

Many Thanks

Flick. x

Nov 13 '05 #4
AP
Johnny' s response would require knowledge of VBA, while his method
would also work well, it is a bit more complicated. If you choose to
use the expression mentioned in my previous post, you would enter it in
the query window as an expression.

Nov 13 '05 #5
Thankyou very much for your help - i've place the expression you
suggested into the QBE window and then run the query - all this
expression seems to do is duplicate what Table1 Field1 displays. ie:

Record1
Table1 TITLE = MR.
Table2 TITLE = MR
Exp = MR. (same as Table1 TITLE)
Record2
Table1 TITLE = DR.
Table2 TITLE = DR
Exp = DR. (same as Table1 TITLE)

Any idea?

Thank you once again

Flick. x

Nov 13 '05 #6
rkc
ge*********@hot mail.com wrote:
Hi,

I'm trying to compare two TITLE fields from different tables to locate
anomolies - however Table1 TITLE field contains a dot(.) after some of
the entries, however i want to remove the dot so i can compare properly
(the dot is irrelavant to my comparisons):

Record1
Table1 TITLE = MISS.
Table2 TITLE = MISS
Record2
Table1 TITLE = MISS
Table2 TITLE = MISS


So an anomaly in this case is a value in table1 that isn't in
table2?

Maybe...

SELECT Table1.Title
FROM Table1
LEFT JOIN Table2
ON Table1.Title = iif(Right(Table 2.Title,1) =".",
Left(Table2.Tit le, Len(Table2.Titl e)-1),
Table2.Title)
WHERE (((Table2.Title ) Is Null));
Nov 13 '05 #7

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

Similar topics

7
7768
by: Qiangning Hong | last post by:
I want to make an app to help students study foreign language. I want the following function in it: The student reads a piece of text to the microphone. The software records it and compares it to the wave-file pre-recorded by the teacher, and gives out a score to indicate the similarity between them. This function will help the students pronounce properly, I think. Is there an existing library (C or Python) to do this? Or if someone
1
1968
by: Simon Gare | last post by:
Hi I need to compare a dynamic field in an asp page to a field in another table, if there is no match then i would like to chane the row colour ( see code below). The problem Im having is that the comparison should be one of many entries in that db field, at the moment it only compares the first field in the db. Please Help
5
10882
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the new database. For instance, her old database has a table with Band Info in it. Her new database also has a table with Band Info in it but slightly different. I was wondering if there was an easy way to compare the fields from similar tables in...
9
5604
by: geronimo_me | last post by:
Hi, I am atempting to compare part of a field with the whole of another field in access. Is this possible? Basically I have 2 tables with the following info: Table1 Field1 = MR.
0
1816
by: Shaw | last post by:
Our database is constantly updated (input data) from another DB, and sometimes it crashes our ASP.NET applications. My boss told me to write a DB utility app to check DB and make sure all apps are still running. The first step of few checks is to compare current DB tables with yesterday’s tables. I store yesterday’s tables at a XML file (DB is maintained by another guy, and certainly they don’t want me to make back copy for few...
5
6341
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of uniqueidentifier, originally taken from objectGUID from active directory domain)
17
4534
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are selected into 2 different SP variables and compared for equal. They are both NULL, but do not compare as equal. When the Not NULL columns (SALARY) are compared, they do compare as equal.
3
5726
by: gmazza via AccessMonster.com | last post by:
Hi there, I am trying to run a report using a parameter for where the user chooses a month from a combo box. Then on the report, I want it to compare the month to a date field and choose only those dates with the month chosen from the parameter form. Basically, its to see who's birthdays are coming up. So on the parameter form you choose November, so then I want the report to display all the kids who's birthdays are in November. Any help...
6
7723
by: napatel04 | last post by:
Hi everyone, I would like to know if there is a quick query someone can help me write for the following scenario. I think I can do this with VBA but since this is suppose to be a temp. solution, I really do not want to spend too much time on it. I have two tables, 1 an old one which has work done in it with all the necessary columns correctly populated with the data and the second one I need which has the same columns but need to be...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10001
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.