Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Which of multiple fields are checked for a region?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-25 : 18:17:17
Ann writes "I have to display data from an Access 2000 database "designed" by someone else. We're going to set up a SQL Server job to pull the info from Access into SQL Server 7 each night (running on Win2K Server), but I'm stuck trying to figure out how to handle part of the display.

The data is related to job postings. Each record contains info about a particular job opening. Among countless other fields, each record has:

Region (could be US, Canada, or the UK)
Job_Acc = Accounting/Finance
Job_e = e-Learning
Job_Eng = Engineering
Job_Gen = General Administrative
Job_Info = Information Technology
Job_Mang = Management
Job_Mark = Marketing/Business Development
Job_Tech = Technical
Job_Train = Training

The 9 Job_* fields are all yes/no fields - if the value = 1, the job opening falls under that category; if it's 0, it doesn't. Each job opening must be assigned to one or more categories (so a job might be 'e-Learning' and 'Marketing/Business Development', for example, or just 'Management').

On the page from which people will start searching the job postings, I want to display a list of available categories for the selected region (determined by a list box selection), with check boxes, so that people can narrow the search. (Here's an example of how it currently looks - driven off a different database: http://www.gpworldwide.com/about/jobs/.)

In the current database, each job opening is assigned to only one
category, and I have a field that contains the category code - this makes it simple to pull a unique list of categories from the postings.

But with the way it's going to be set up, I'm at a loss. How can I easily pull a list of all the used categories from the records? Do I need to loop through all nine fields, and do a count(*) WHERE Job_Acc = '1', and if the count(*) is > 0, display the checkbox? That seems incredibly cumbersome.

I could, if necessary, add a query to the Access database, but I can't change the structure of the Access table itself.

HELP?!?!?!?"
   

- Advertisement -