Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Mircosoft Jet SQL and SELECT DISTINCT

Posted on 2004-03-29
2
531 Views
Last Modified: 2012-05-04
Hey,

got a quick(hopfully) question. I have a need to do a distinct select statment, how ever all the documents that i have googled for seem to be giving me the wrong info.

I have been trying to do a:

SELECT DISTINCT Purchaser_Seller FROM Transactions WHERE TransType='Purchase';

however it doesn't work when i try to shove it through Microsoft Jet. When i try it just in access it askes for a value for Purchaser_Seller. If i enter in a number it just returns the number. Or if i type in somthing like 'asdf' it returns four rows all with asdf in them. Every document that i have read has giving me the idea that this should work. I did read some posts on EE and they suggested somthing different which i tryed but only got a sytax error. Heres what the posts suggested:

SELECT DISTINCT CAST (Purchaser_Seller varchar(50)) FROM Transactions WHERE TransType='Purchase';

Does anybody have any ideas to why nether of these seem to work, or an idea that would point me in the right direction. A quick response would be great because i am working on a bit of a deadline. Thanks for any help that you guys can offer in advance.

-Pizentios
0
Comment
Question by:Pizentios
2 Comments
 
LVL 2

Accepted Solution

by:
michaelbartolotta earned 500 total points
ID: 10707747
Well, your syntax looks correct.
If Access is asking for a value for Purchaser_Seller, that's telling me that you don't have a field Purchaser_Seller in the Transactions table, so Access is assuming it to be a parameter. Check your spelling.
From your code, the table Transactions should contain a column Purchaser_Seller and another column TransType.
If that's not the case, let's take a closer look at what you're trying to accomplish and see if we can't solve it together.
Don't be afraid to put more detail in your question, there's no space limit here and the more you put the quicker and more completely we can answer you.
-MiKe
0
 

Author Comment

by:Pizentios
ID: 10708155
your right about the spelling, i was one letter wrong on Purchaser_Seller. In the db it was labeled wrong, thanks for the help, i feel kinda stupid now..heh

-Pizentios
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question