473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access Query help

3
I have a database set up for contacts.

One of the fields in the table for employees is "skill set"
I.E. "project management" or "QA, Technical, and Operations"

If I make a querry for only "project management" I have no problem getting those individuals whose only skill set is "project managment" to show up

On the other hand, when I need to querry merely "QA" - the individuals who show up are those with only "QA" in their skill set.

I need to able to retrieve the "QA" out of the individual whose skill set is "QA, Technical, and Operations"

Do I need to create separate fields for each skill set? Or is it possible to retreive certain data out of the "skill set" field by using a criteria which only searches exactly what is under the skill set field?

Thanks, Rich
Oct 24 '06 #1
9 1612
NeoPa
32,556 Expert Mod 16PB
Do you have multiple Skill Sets per person / record?
Or do you need to select records which match any one of Skill Sets A; B; ...?
Oct 24 '06 #2
rkook
3
I'm pretty sure the answer is yes to both questions...

some people have multiple "skill sets" - which is the column.
Like Harry has A, B, C, like you said, and that is all in one record.

And yes, I need to be able to pull up all people in a querry with skill set A,
and i'll be building querries as I go - for example, all with skill sets A, C, and Z,

All the info is in one table at the present
Oct 24 '06 #3
NeoPa
32,556 Expert Mod 16PB
In that case, we need to know how the multiple Skill Sets are stored in a single record.
Is it a text field with a particular character denoting the end of one and the start of another? or how exactly?

Multiple matching is ok when it's one-to-many, but many-to-many gets very fiddly.

Try to explain clearly what you've got; what you want; and use data that's not too complicated in itself, to avoid misunderstanding.

There are answers to most things somewhere - understanding the question is critical to finding the correct one.
Oct 24 '06 #4
rkook
3
i think how i'm storing the skill set(s) in the record is the problem.

They are text, but i DO NOT know how to write it in the record in any certain code or form.

The way they are listed in query now is as follows "AQ, manager, technical"
with no certain spacing or characters - that is what i'm looking for
Oct 24 '06 #5
NeoPa
32,556 Expert Mod 16PB
Ah, now I better understand your original post.

Give me a while and I'll look into this.
We ARE getting into complicated territory here with many-to-many selection so some of the sneaky tricks won't work - prepare for longhand code.

I'll get back to you.
Oct 24 '06 #6
NeoPa
32,556 Expert Mod 16PB
If you formulate your skills as ALWAYS having separator characters surrounding each item (I'll use the vertical bar as this is my habit) then that will make life easier later.
EG. If you have skills A; B; C; D; E; F; G then User 1 might have skill C (or "|C|") and user 2 might have skills B, D & E (or "|B|D|E|"). Notice the bar before and after each item - including the first or only item.

We need to use the function InStr() - Help system gives full details of function.
If you want a list of users who have skill D, for instance, you :-
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tblUsers
  3. WHERE InStr(Start:=1, String1:=[Skill Set], String2:="|" & "D" & "|")>0
NB. Although it's coded here showing the parameter names, this function only works correctly if parameters are passed positionally. So, to work, it should be :-
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tblUsers
  3. WHERE InStr(1, [Skill Set], "|" & "D" & "|")>0
To select more than one skill set (User must have skill A AND D or even A OR D) then you must put the ANDs or ORs in the WHERE clause between multiple 'InStr's

Have fun
Oct 24 '06 #7
NeoPa
32,556 Expert Mod 16PB
Just noticed something that might confuse.
In previous post where the code says
Expand|Select|Wrap|Line Numbers
  1. ..., "|" & "D" & "|")...
, that's where you can replace the hard-coded "D" with a variable or some other. If you were just checking for D you could use "|D|" instead of course.
Oct 24 '06 #8
MMcCarthy
14,534 Expert Mod 8TB
SELECT * FROM TableName
WHERE [skill set] Like '*QA*';


I have a database set up for contacts.

One of the fields in the table for employees is "skill set"
I.E. "project management" or "QA, Technical, and Operations"

If I make a querry for only "project management" I have no problem getting those individuals whose only skill set is "project managment" to show up

On the other hand, when I need to querry merely "QA" - the individuals who show up are those with only "QA" in their skill set.

I need to able to retrieve the "QA" out of the individual whose skill set is "QA, Technical, and Operations"

Do I need to create separate fields for each skill set? Or is it possible to retreive certain data out of the "skill set" field by using a criteria which only searches exactly what is under the skill set field?

Thanks, Rich
Oct 25 '06 #9
NeoPa
32,556 Expert Mod 16PB
I overlooked the 'LIKE' construct in my answer - that's a much better way of doing it.
I would recommend using the separator characters in a search though, as that precludes overlap.
To illustrate :-
You may have an 'IT' skill set as well as an 'IT Developer' skill set.
To search for just 'IT' you need to have separator characters around it...
Expand|Select|Wrap|Line Numbers
  1. WHERE [Skill Set] LIKE "*|IT|*"
...finds ONLY the 'IT' one.
Oct 25 '06 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Morten Gulbrandsen | last post by:
Hi programmers, Good morning ;-) I think something is wrong, Running windows I believe first I have to set some password, Which creates some user, Then I can grant the required privileges, for...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
13
by: Peter James | last post by:
Access 97 If I select New on the Query tab of the db window, and go staight to sql view and type in the following for example: INSERT INTO tblMyTable ( dtDate, txtAny) VALUES (#2003-09-03#,...
1
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
4
by: Takeadoe | last post by:
Hey Gang, I'm gearing up to retool for the upcoming deer season here in Ohio and I could use some help with very general questions about direction. I will be scanning nearly 210,000 forms that...
1
by: hardik | last post by:
hi friends i need help in this sql query i have table like, id fid __ _____ autonumber text and i am storing values like
8
by: Sid | last post by:
I hope someone could help me with this. I am trying to setup a criteria to decide when to allow/not allow user to click on the check box. logically it looks simple but I am not able to...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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...

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.