Mircosoft Jet SQL and SELECT DISTINCT
Posted on 2004-03-29
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.