WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-16-2008, 09:49 AM
texxs's Avatar
texxs texxs is offline
WebProWorld Veteran
 

Join Date: Jul 2005
Location: Somewhere in scrub of Florida
Posts: 324
texxs RepRank 0
Default DISTINCT Query probs

Imaginary table in a MS Access 2000 Database:

Table Name: Assign

Column Names/type

Column 1: ID
Primary Key, data type=text
must be unique

Column 2: ZipCode
text

Column 3: SalesRep
text

I'm trying to perform the following:
Change the value of the SalesRep column for all records with the samezipcode WHERE SalesRep=NULL.

We need to assign thousands of these records to dozens of reps based on the geographical area (zipcode) and how many we feel they can do in a week.

right now were printing a report and having an exec do the "assigning" on paper. Then it has to entered into computer by someone. Very time consuming, so I'm making a form in the DB or web based that will help.

I can get a list of what I need to see but I can't get an editable one:
SELECT DISTINCT ZipCode, SalesRep
FROM Assign
WHERE (((Assingn.SalesRep) Is Null)) = True;


GEEZ, I was soooo wordy above, sorry about that . . .

What am I missing?

Thanks all
__________________
Take a break and watch some stupid video clips
Reply With Quote
  #2 (permalink)  
Old 03-16-2008, 10:30 AM
thindenim's Avatar
thindenim thindenim is offline
WebProWorld Pro
 

Join Date: Jan 2007
Location: Scotland
Posts: 236
thindenim RepRank 1
Default Re: DISTINCT Query probs

I may be reading the above wrong, but would the following not do the trick?

UPDATE Assign SET SalesRep = 'blah' WHERE SalesRep = NULL AND ZipCode = x;
__________________
Girlz Night - professional hair and beauty products
Web design glasgow - from Thin Denim
Reply With Quote
  #3 (permalink)  
Old 03-16-2008, 11:49 AM
texxs's Avatar
texxs texxs is offline
WebProWorld Veteran
 

Join Date: Jul 2005
Location: Somewhere in scrub of Florida
Posts: 324
texxs RepRank 0
Default Re: DISTINCT Query probs

"UPDATE Assign SET SalesRep = 'blah' WHERE SalesRep = NULL AND ZipCode = x;"

Nice try but if I attached that to any type of form, then I would have to run the query once for each zipcode


I'm trying to make a form (access or ASP.NET based) that lists the zipcodes, with an editable SalesRep field next to it. Because we often have dozen of records for each zipcode and we have dozens of inspectors we'd like to "assign" records to.
__________________
Take a break and watch some stupid video clips
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: database, ms access, ms access 2000, sql



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding more content - fearing diluting PR and getting SI probs privatefleet Google Discussion Forum 70 10-22-2007 08:53 AM
MySQL query works on CLI or Query Browser but NOT in PHP CraigB Database Discussion Forum 4 09-28-2006 10:39 AM
Googlebowling A Distinct Possibility Chris Insider Reports 14 06-16-2006 06:36 PM
Newbie having google search probs irobotix Google Discussion Forum 8 04-21-2004 12:30 AM
Mhhh image probs Ion Graphics & Design Discussion Forum 6 03-10-2004 10:04 AM


Search Engine Friendly URLs by vBSEO 3.0.0