Matching Case
Oct 24, 2007
I have two tables that have fields set to a text so that the ClientID is their name.
When I query, my queries don't take into account the case. So "K Smith" is the same as "K SMITH" as "k sMIth"
I am trying to write an unmatched query between two tables based on this ClientID but it will turn up no unmatched because it is not taking into account the case.
Any suggestions on how to match the cases, othere then changing the table?
Thanks.
View Replies
ADVERTISEMENT
Mar 16, 2013
Is there any way of making data that is inputted in lower case to automatically change to the first letter of each word being a capital ...
View 4 Replies
View Related
Aug 24, 2004
hi
help is needed yet again :-)
I know when creating a text field in the format option
you can use the > or < sign so that when text
is entered it automatically changes it to uppercase or
lowercase - but i need it to be Title Case, any one know
how I can do this....
View 11 Replies
View Related
Apr 7, 2006
I have an Option Box that contains three Report Choices, Report1, Report2 and Report3. I want to run the Reports. I coded using If-Then and it worked out fine. See code below:
Private Sub Frame0_Click()
If Me.Frame0 = 1 Then
DoCmd.OpenReport "Report1", acViewPreview
ElseIf Me.Frame0 = 2 Then
DoCmd.OpenReport "Report2", acViewPreview
Else
Me.Frame0 = 3
DoCmd.OpenReport "Report3", acViewPreview
End If
End Sub
I would like to get the same result using "Case." However, when I use the Case format, it does not show all the reports as it does in the IF -Then format. See Case format below:
Private Sub Frame1_Click()
Dim Test As Integer
Select Case Test
Case Me.Frame1 = 1
DoCmd.OpenReport "Report1", acViewPreview
Case Me.Frame1 = 2
DoCmd.OpenReport "Report2", acViewPreview
Case Me.Frame1 = 3
DoCmd.OpenReport "Report3", acViewPreview
End Select
End Sub
Something simple is missing at the top. Please advise as to how to correct this?
View 3 Replies
View Related
Sep 28, 2004
Someone was helping me out and sent me the attached code to connect to a SQL server from Access2000 in a query. Access doesn't use the CASE statement, but the IIF statement instead. Can any of you help in deciphering the below CASE statement into an IIF statement?....
View 2 Replies
View Related
Jul 24, 2005
Can I use a [system number] value stored in a table in a select case?
Select Case [system number] "Tble system numbers"
Case 42144
do this
Case 88754
do this
???
Jon
View 6 Replies
View Related
Jul 26, 2005
I have this code in an event property on a report and it is working great. However, I now need to do a second case based on which modules are down. Is it possible to have a select case within a select case? I have the select case for the systems now with in each system I need a select case based on modules?
Dim dbs As DAO.Database
Dim rst AS DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Select * From YourTable")
While Not rst.EOF And Not rst.BOF
Select Case rst![System Number]
Case 42144
' do this
Case 88754
' do this
Case Else
' do this
End Select
rst.MoveNext
Wend
rst.Close
Set rst = Nothing
Set dbs = Nothing
View 4 Replies
View Related
Mar 4, 2006
Hello All,
For those who are interested in Approximate String Matching or those who could use these algorithms; I have a complete suite of Approximate String Matching algorithms written in Visual Basic in an Access database.
In 2004 I decided to jump into the world of Fuzzy Matching with both feet.
As it is, I am working for a company that deals with names, addresses, etc. very intensely. It is a fair sized company that
uses Access on a grand scale. Since I am an Access programmer, I work in an Access gold mine!
I knew that if I could get a good handle on Fuzzy Matching, that when I hit the right person at the right time, the company could greatly benefit from my research on Fuzzy Matching. The right time and the right person are not here yet.
Nevertheless, since I have reaped much free source code and information from the Web, it is now time to return the favor.
I developed a package that is sort of a demo/tutorial on Approximate String Matching algorithms in Access that is very
robust in Fuzzy Matching. It would overtax the post in this forum for me to include it in a post.
To summarize, it works with the basic name - Last, First, and Middle. It has a user interface that allows a user to type in
what would be a good name and what would be a questionable name to resemble the good name. The weighted results of all the various algorithms can be chosen, or an individual algorithm can be chosen to display how closely the names match.
In addition, it has a table of 17,295 known good names with unique ID numbers as a reference table, and table of 1200
morphed names that are typical of names entered in a database with no input conventions. These morphed names have typos, transpositions, variations on maiden names, etc. 1200 good names were selected for alteration and the unique ID of each original good name was stored in the table with the altered names to determine the accuracy of the matching process.
The morphed names were compared to the known good names in a query with an approximate join using the suite of algorithms to determine match percentage. The altered names, the ID number of the original good name, the ID number of the name it matched to, and the match percentage were stored in a results table to determine the results of the matching run.
These tables were used to test and tweak the algorithms by comparing the morphed names with the known good names. The results of 1322 names were saved to a results table with match scores.
The matching process was executed in a query with an approximate join using the suite of algorithms.
The match results:
Total Approximate Matches: 1188
(Recall) Precision Pct: 99.00%
Total Unmatched Names: 12
Unmatched Pct: 1.00%
Total Other Matches: 134
Other Matches Pct: .77%
The tables are accessible in the database, so anyone can run their own tests. The interface is set up to accommodate this
as well.
The algorithms used: Dice coefficient as a threshold algorithm, Levenshtein Distance algorithm, Longest Common Subsequence, and the DoubleMetaphone. The names were passed to the algorithms by way of the bigram model.
I will email it to anyone who requests it.
It is in two platforms, Office 97 and Office 2000 as FuzzyMatching97.zip (692 KB) and FuzzyMatching2k.zip (721 KB).
The zip files include ApprxStrMatchingEngine97.pps or ApprxStrMatchingEngine2k.pps respectively, StrMatching97.mde or StrMatching2k.mde respectively, IEEESoundexV5.pdf, and VBAlgorithms.txt.
IEEESoundexV5.pdf is an abstract about Approximate Sting Matching that fired my curiosity about the subject, and pertains to the package.
VBAlgorithms.txt contains the entire suite of algorithms in Visual Basic extracted from the MDB modules.
The PowerPoint presentations describe the workings of the MDE and give a good overview of Fuzzy Matching.
To match is divine....
View 10 Replies
View Related
Dec 22, 2004
A very elementary question - but I'd be grateful for an answer.
I have two tables (or perhaps two queries) each with a key field. If all is well, there should be complete correspondence between the two sets of records. That is, if there's a record with key 12345 in one table, there should also be a record with key 12345 in the other table.
I'm looking for the simplest way of checking whether or not this is the case, and, if it's not, detecting which records in one table are unmatched by any record in the other.
Will
View 1 Replies
View Related
Jan 1, 2007
How can I set up a table so that as we assign a case it generates a new number with the year in front of it. I would like for the case number to be generated by the program and when someone enter a new case the program generates the next case number and assignes it to that case. The format we use for our file numbers are year-XXXX (ex: 07-0001). With the new year I'm trying to set this up so that as we start the year the computer will generate the new number.
View 1 Replies
View Related
May 2, 2007
Any ideas how to Capitalise data in a table.
View 14 Replies
View Related
May 23, 2005
Hi,
I am trying to run the following query and getting an error. It looks like its because of the Case Statement.
SELECT Role.RoleID, Objects.ObjectID,
CASE MID(Objects.ObjectName, 4, 2)
CASE 'SR'
0
CASE ELSE
2
END AS AccessType
FROM Role, Objects
WHERE (Role.RoleID > 2115)
Can you give me suggestions plzzz
Thanks,
View 2 Replies
View Related
Jun 28, 2005
Hi everybody,
I'm having quiete a problem with the case instruction. I have the folowing query:
Select station, count(case poc_1 when 1 then 1 end), count(case poc_1 when 2 then 1 end)
From poc
group by station
Well Acces tells me there is a syntax error in the case instruction???Can't find!!!Can anybody help? Tanx
View 4 Replies
View Related
Jun 29, 2005
Hi,
I'd like to know if the keyword CASE, or IF... is recognized in Access (sql) queries.
If not, wat should I do to implement a condition, in a query or in the source of a textbox in a report ?
The problem : I have a report that use this query in a calculated field, and I want to avoid results that are equal to zero (i.e.divising by zero).
Thanks :)
Twinpath
View 3 Replies
View Related
Sep 7, 2005
Hello,
I am using this query to get matching data:
SELECT NewMyEstartChild.yordob, NewMyEstartChild.firstname, NewMyEstartChild.surname, NewMyEstartChild.postcode
FROM NewMyEstartChild INNER JOIN For2003 ON (NewMyEstartChild.postcode = For2003.POSTCODE) AND (NewMyEstartChild.yordob = For2003.MyDOB);
but It's giving me more data so to minimise data I was thinking to add another filed. which is Firstname field. but some children's name are spell incorrectly.
How can I match data with first letter only ? I have tries following query but it doesn't work. Please help!!!!!!!!
SELECT NewMyEstartChild.yordob, NewMyEstartChild.firstname, NewMyEstartChild.surname, NewMyEstartChild.postcode
FROM NewMyEstartChild INNER JOIN For2003 ON (NewMyEstartChild.postcode = For2003.POSTCODE) AND (NewMyEstartChild.yordob = For2003.MyDOB) AND (NewMyEstartChild.Firstname = For2003.Firstname);
In last part of this query (NewMyEstartChild.Firstname = For2003.Firstname); How can I get the name of children whose firstname's letter is similar.
Thank you
Viral
View 3 Replies
View Related
Nov 15, 2005
My problem is this:
I have a large table with about (8000+) records and a smaller table (2000+) records.
The large table has been exported from an ACT! database.
The smaller table has 4 fields that i need to add to the larger table, and then i need to import the updated records back into the Act! database.
I created a simple select query and matched the tables with the only 2 criteria that match the 2 tables, this was "Company" and "PostCode".
This should have been ok, but instead of updating 2000+ records it only updated 1000. The reason for this is because some of the company names weren’t an exact match, "company ltd" and "company limited" etc.
If i just linked "postcode" to "postcode" there are quite a few different companies that have the same postcode.
Is there a way of trying to match just the first 5 characters of the company name but leaving the "company" field intact?
Or is there a different way to go about this?
Thanks
Darren
View 3 Replies
View Related
May 9, 2006
Im trying to work something out on Access at the moment to score some brownie points with my boss and am hoping someone will be able to help me. Im relatively confident about using access but when it comes to tricky queries i get a bit confused. Basically my situation is that i need to do some matching. Using a PO number and a unique ID and updating a column in one of my files with the unique ID. I have done it this way so far....
Linked the the two files together and matched them on the PO number and then updated the field with the ID where they matched. This seems to work ok, but the problem is that about 10 of the PO numbers contain between 2 to 6 different ID's. Therefor how can i make it so that if there is a PO number 6 times in the file it will match with all the ID's. I dont think that this is to hard to do, but each line has a different cost and they have to be matched to the write one. The problem with this is the cost is normally different as it flucuates with the exchange rate. I can only think that the best way to do this is to use a function that looks at the cost and if its say $20.00 more or less then assume its that. But have no idea how to implement it.
Does that make sense? Is it likely that its going to be easy to do. Im relatively ok with SQL if it would be easier to use that.
If anyone has any suggestions it would be greatly appreciated...
Thanks :)
View 4 Replies
View Related
Oct 10, 2006
Hi here is the original code
MAX(IIf([Book]='C',[Score]," ")) AS CScore,
Max(IIf([Book]='C',[PercentileScore]," ")) AS CPercent,
Max(IIf([Book]='C',[PassFail]," ")) AS C,
Max(IIf([Book]='D',[Score]," ")) AS DScore,
Max(IIf([Book]='D',[PercentileScore]," ")) AS DPercent,
Here is what I thought may work, but it seems like there should be an easier way
Case when Max ([Book]) = 'C' then [Score] else null as CScore,
Case when Max([Book]) = 'C' then [PercentileScore] else Null as CPercent,
Case when Max ([Book]) = 'C' then [Passfail] else Null as C,
Case when Max([Book]) = 'D' then [Score] else Null as Dscore,
Case when Max ([book]) = 'D' then [PercentileScore] eslse Null as DPercent,
Thanks
K
View 3 Replies
View Related
Jun 19, 2007
Hi All,
Wondering if you can help I have a table called "example" which has field "a" "b" "c" "d"...
I then create another table called "importtable" with field "a" (imported in from Excel)...
I would then like to create a query which matches any and shows all the records which I imported in from Excel to my current table called "example" I looked at joining via "relationships" using a Select Query but it doesn't quite show what I'm after...
Should add I would like Field "a" in both tables to show but only if the number exists in the "importtable" if not then don't show..
Any tips :confused:
View 1 Replies
View Related
Aug 6, 2007
We have two databases that I am tryin to match it one variable, we get it to to match and take from the first database and enter it in the second but I was wondering how I can get a report on the ones that didnt match. Im sorry if this is a simplistic problem but I am kind of new to Access and didnt know where else to turn to help.
View 2 Replies
View Related
Dec 19, 2007
Hello, I'm attempting to use a case statement in order to select fields from a column that have names and addresses mixed. I'm wanting to select only the fields that contain names. For example some fields start with an address of "1998 Sky Rd" or PO BOX, or Suite at the beginning of the field. I would like to first select all fields with names in the field and then use an update statement to move/switch fields to another column. The only problem is that I can't seem to get this query to work. Please help!!!
Thank you!!!!!!!!!
SELECT address1, name3=address1 as expr1
Case [address1]
When mid([address1],1,1) Like [A-Z] then [address1]
When [address] is null then ""
When [address] = "" then ""
Else 'Null"
End,
FROM Exercise1;
:confused:
View 9 Replies
View Related
Mar 21, 2005
i have a form, and i would like that on one of the fields, as soon as i type something in it when i leave the field, i want it to automatically convert it to title case. can this be done please?
Cheers
View 1 Replies
View Related
Oct 27, 2004
New at this and need help!
I am trying to calculate a date in the future based on an entered date and the sample falling into one or more categories.
Fields: Start Date, manually entered
Interval, combo box, choice of monthly or weekly
Pull Interval, combo box, choice of Long term, Short Term, or Stressed
Conditions, combo box, choice of 25°C, 40°C, or 60°C
1 Week, calculated field
3 Month, calculated field
What I would like to happen is that when the Interval box is the choice of monthly that the 3 Month field calculates the date 3 months from the start date. Also, if the Interval field is weekly the 3 Month field is to be left blank.
I have managed the Dateadd function to calculate the 3 month date, but do not know how to incorporate the condition of the weekly statement to leave the 3 month field blank.
Also where should I put this, right now I have this calculation in a subform. Would it be best to generate this in a query? and if so how do I set this up?
Also, I need to select that the Pull Interval is Long term that I can only choose the Conditions field, 25°C, Interval field as Monthly, and only calculate the 3 month time point. Same thing with the Short term and stressed Pull Intervals, I want when they are selected to only allow me to look at fields relative to those conditions.
Any help would be extremely appreciated. I have several books and they are not spelling out exactly what I need, and with my limited programming experience I am stuck.
Thanks
ChrisB37
ChrisB37View Public ProfileSend a private message to ChrisB37Find all posts by ChrisB37Add ChrisB37 to Your Buddy List
View 1 Replies
View Related
May 3, 2005
Hi. I am in the process of loading nursing license numbers into my database. The spreadsheet that I am importing from does not use the exact same names as the ones in my database, i.e. Smith, Deb in my database is Smith, Debora in the spreadsheet and I can't figure out the code or procedure to use to tell the database that these names are actually for the same record. Is it possible to do this and if so, how?
Thank you!
KellyJo
View 3 Replies
View Related
Nov 1, 2005
I have a linked table that updates regularly. It stores all words in Upper Case. I would like to mail merge out of a query but I would like to format the words so that the first letter is Upper Case and the rest of the letters are Lower Case. I have tried formating the field in the query but this doen't work.
Any way to do this?
View 7 Replies
View Related
Feb 20, 2006
Can someone put a newby straight please?
Why do I get a 'NAME' error from this?
Many thanks in advance
Don
Select Case SortOrd
Case "a": Me.SortOrd.DefaultValue = "B"
Case "b": Me.SortOrd.DefaultValue = "C"
Case "c": Me.SortOrd.DefaultValue = "D"
Case "d": Me.SortOrd.DefaultValue = "E"
Case "e": Me.SortOrd.DefaultValue = "F"
Case "f": Me.SortOrd.DefaultValue = "G"
Case "g": Me.SortOrd.DefaultValue = "H"
Case "A": Me.SortOrd.DefaultValue = "B"
Case "B": Me.SortOrd.DefaultValue = "C"
Case "C": Me.SortOrd.DefaultValue = "D"
Case "D": Me.SortOrd.DefaultValue = "E"
Case "E": Me.SortOrd.DefaultValue = "F"
Case "F": Me.SortOrd.DefaultValue = "G"
Case "G": Me.SortOrd.DefaultValue = "H"
'Case Else
'Me.SortOrd.DefaultValue = "Oops"
End Select
View 2 Replies
View Related