Mike "Wuzzy121". Rest in peace, brother

Go Back   Tacoma World Forums > Off-Topic > Technology

Notices

You an Access 2010 Guru? Help please.

Reply
 
Thread Tools Search this Thread
Old 06-13-2013, 11:48 AM   #21
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
Unless you have a field named "key" it will fail. It thinks it's a function.
I created a field call "Key" in my table and added it to the qry_InfoPACCAck&TTA query.
  Reply With Quote
Old 06-13-2013, 11:59 AM   #22
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
I created a field call "Key" in my table and added it to the qry_InfoPACCAck&TTA query.
Try a different name for the field. Like pkey. It might be a reserved word in Access (like "Date").
  Reply With Quote
Old 06-13-2013, 12:00 PM   #23
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
I just looked it up. It is a reserved word. Change it to pkey.
  Reply With Quote
Old 06-13-2013, 12:18 PM   #24
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
This worked:

SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstOfTicketNumber
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].pKey;
  Reply With Quote
Old 06-13-2013, 12:34 PM   #25
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
This worked:

SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstOfTicketNumber
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].pKey;
Cool. So now, include pkey in your original query and Inner Join on qry_InfoPACCCAck&TTA.pkey = to that view's pkey (whatever you named it).
  Reply With Quote
Old 06-13-2013, 02:48 PM   #26
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
Cool. So now, include pkey in your original query and Inner Join on qry_InfoPACCCAck&TTA.pkey = to that view's pkey (whatever you named it).
I had to uncheck the show box for pkey to work on that query. So I don't have it to Join.
  Reply With Quote
Old 06-13-2013, 03:03 PM   #27
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
This worked:

SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstOfTicketNumber
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].pKey;
Add the pkey to this query's result

So:
SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstOfTicketNumber, First([qry_InfoPACCAck&TTA].pKey) as pkey
FROM [qry_InfoPACCAck&TTA]
  Reply With Quote
Old 06-13-2013, 03:20 PM   #28
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
I'm making a sample database to check the query. Hold Please...
  Reply With Quote
Old 06-13-2013, 03:31 PM   #29
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Okay, so make a new query and use this as the SQL:

SELECT [qry_InfoPACCAck&TTA].iTrackerTeam, [qry_InfoPACCAck&TTA].Shift, [qry_InfoPACCAck&TTA].infoPACCTicketAssignee, [qry_InfoPACCAck&TTA].TicketNumber, [qry_InfoPACCAck&TTA].CallType, [qry_InfoPACCAck&TTA].TTA
FROM [qry_InfoPACCAck&TTA]
INNER JOIN UniqueTicketNumber ON [qry_InfoPACCAck&TTA].pkey = [UniqueTicketNumber].pkey;
  Reply With Quote
Old 06-14-2013, 08:00 AM   #30
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
Add the pkey to this query's result

So:
SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstOfTicketNumber, First([qry_InfoPACCAck&TTA].pKey) as pkey
FROM [qry_InfoPACCAck&TTA]
^ This only returns one record.

Quote:
Originally Posted by Evil Monkey View Post
Okay, so make a new query and use this as the SQL:

SELECT [qry_InfoPACCAck&TTA].iTrackerTeam, [qry_InfoPACCAck&TTA].Shift, [qry_InfoPACCAck&TTA].infoPACCTicketAssignee, [qry_InfoPACCAck&TTA].TicketNumber, [qry_InfoPACCAck&TTA].CallType, [qry_InfoPACCAck&TTA].TTA
FROM [qry_InfoPACCAck&TTA]
INNER JOIN qry_InfopaccTickets_NoDupes ON [qry_InfoPACCAck&TTA].pKey = [qry_InfopaccTickets_NoDupes].pKey;
^This asks for me to enter the parameters for qry_InfopaccTickets_NoDupes.pKey because I don't that shown in that query because it only returns one record.
  Reply With Quote
Old 06-14-2013, 11:09 AM   #31
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
^ This only returns one record.



^This asks for me to enter the parameters for qry_InfopaccTickets_NoDupes.pKey because I don't that shown in that query because it only returns one record.
I edited it yesterday to include first (...pkey) as pkey. Double check that yours is the same as written. It works in my dummy database.
  Reply With Quote
Old 06-14-2013, 11:38 AM   #32
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
I edited it yesterday to include first (...pkey) as pkey. Double check that yours is the same as written. It works in my dummy database.
Yeah, I tried that one, but it only comes back with one record.

I tried it in a clean query.
  Reply With Quote
Old 06-14-2013, 01:38 PM   #33
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Are you getting the pkey with the one record?
A ticketnumber and a pkey?
  Reply With Quote
Old 06-14-2013, 02:10 PM   #34
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
Are you getting the pkey with the one record?
A ticketnumber and a pkey?
tone record showing one ticketnumber and pkey
  Reply With Quote
Old 06-14-2013, 03:20 PM   #35
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
tone record showing one ticketnumber and pkey
I wonder why the join fails if you have a pkey in both queries.

Unfortunately, I am not a my work computer. All I have right now is my phone. I won't be able to help again until monday.
  Reply With Quote
Old 06-14-2013, 03:29 PM   #36
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Try adding a group by pkey in the unique ticket number query. I don't recall if I had to take that out or put it in.

Btw, your pkey is unique for each record, correct?
  Reply With Quote
Old 06-17-2013, 09:50 AM   #37
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
Try adding a group by pkey in the unique ticket number query. I don't recall if I had to take that out or put it in.

Btw, your pkey is unique for each record, correct?
Yes, I have access autonumbering the Primary Key field in a table I created. I copied over the records for the month I need to report on.

I have tried the unique ticket queue as grouped by and not grouped by (unclicked show). I get only one record returned when I do group by. But when I unclick show, it works, eg gives me all the tickets listed without any duplicates.

Quote:
Originally Posted by With pKey "Show" unclicked
SELECT DISTINCT First([qry_InfoPACCAck&TTA].TicketNumber) AS TicketNumber
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].pKey;
^ Yes, I am using the DISTINCT command here, that is the only way it works.

Quote:
Originally Posted by With pKey "Show" clicked
SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS TicketNumber, [qry_InfoPACCAck&TTA].pKey
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].pKey;
^ DISTINCT or not does not effect the results, comes back with duplicates.



SO, Then I Join this unique ticket numbers with a different query that has all the other information I need: Associate Name, Shift, ticket call type, etc. I repopulates all the duplicate ticket numbers in the out come.
  Reply With Quote
Old 06-17-2013, 10:18 AM   #38
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
So this is the query for my uniqueticketnumber from my test database (the GROUP BY is "ticketnumber" not "pkey"):

SELECT First([qry_InfoPACCAck&TTA].TicketNumber) AS FirstTicketNumber, First([qry_InfoPACCAck&TTA].pKey) AS pKey
FROM [qry_InfoPACCAck&TTA]
GROUP BY [qry_InfoPACCAck&TTA].TicketNumber;

I have four records with unique pkey numbers and two duplicate ticket numbers:

pkeys:
6, 7, 8, 9
Tickets:
500, 500, 400, 400

When I run the query, I get two records (which is what I would expect):
8, 400
6, 500
  Reply With Quote
Old 06-17-2013, 10:26 AM   #39
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,230
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by Chipskip View Post
^ Yes, I am using the DISTINCT command here, that is the only way it works.
DISTINCT will work here because you're only getting one field back.

Quote:

^ DISTINCT or not does not effect the results, comes back with duplicates.
DISTINCT won't work here because your pkey in combination with your ticketnumber are seperate hits (pkey is unique to each record).

So in my data sample above, I'd get 4 hits since the combination of ticketnumber and pkey are different for each record.

6, 500
7, 500
8, 400
9, 400

e.g. the result of 6 & 500 is different from the 7 & 500 so it qualifies as DISTINCT.

If my database had a duplicate 6 & 500 like this:

6, 500
6, 500
7, 500
8, 400
9, 400

It would ignore the second 6, 500 since it isn't DISTINCT, but I would get all the other records as a result.

DISTINCT doesn't work on just the first field in a multi-field statement. It works against all the data returned in a record.
  Reply With Quote
Old 06-17-2013, 10:38 AM   #40
Chipskip [OP] Chipskip is online now
N7MCS
Chipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shedChipskip is one of the sharper tools in the shed
 
Chipskip's Avatar
Army: 31R, HHB, 2/43 ADA Battalian, 108th ADA Brigade, XVIII Airborne Corps
Name: Chip
Joined: Aug 2010, #42519
Location: Phoenix, AZ
Age: 35
Gender: Male
Posts: 5,425
Chipskip's Tacoma Gallery
Quote:
Originally Posted by Evil Monkey View Post
DISTINCT will work here because you're only getting one field back.


DISTINCT won't work here because your pkey in combination with your ticketnumber are seperate hits (pkey is unique to each record).

So in my data sample above, I'd get 4 hits since the combination of ticketnumber and pkey are different for each record.

6, 500
7, 500
8, 400
9, 400

e.g. the result of 6 & 500 is different from the 7 & 500 so it qualifies as DISTINCT.

If my database had a duplicate 6 & 500 like this:

6, 500
6, 500
7, 500
8, 400
9, 400

It would ignore the second 6, 500 since it isn't DISTINCT, but I would get all the other records as a result.

DISTINCT doesn't work on just the first field in a multi-field statement. It works against all the data returned in a record.
Right, I am completely understanding what you are saying about DISTINCT now. Thank you.
  Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
2010 access cab subwoofer removal MikeZQ 2nd Gen. Tacomas 16 09-14-2013 07:00 PM
2010 Access Cab Manual mallard75 4 Cylinder 27 02-14-2013 12:02 PM
2010 tacoma access cab 4x4 bighungitacoma 2nd Gen. Tacomas 0 09-29-2012 10:29 PM
Lifted 2010 Access Cab Edrin55 2nd Gen. Tacomas 86 02-03-2010 08:48 PM
My 2010 Access Cab, so far. RWS_350MAG 2nd Gen. Tacomas 11 12-01-2009 06:27 AM


Copyright © 2014 Tacoma Forum. Tacoma World is not owned by, or affiliated with Toyota Motor Corporation.