Selasa, 29 Maret 2016

Re: [MS_AccessPros] Re: limiting data from table


I took out the Charge_id and it worked to limit to just those field, thank you  John as always you have helped me again solve a problem that has bugged me for a while


---In, <JohnV@...> wrote :


You could try this:

SELECT  DISTINCT dbo_claim_charges.charge_id, dbo_claim_charges.enc_id, dbo_claim_charges.create_timestamp,
FROM do_claim_charges;

But I'm not sure that will get you what you want.  That will give you one row per unique set of all those fields.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)

On Mar 29, 2016, at 3:32 PM, pattykf@... [MS_Access_Professionals] <> wrote:

I have never written a DISTINCT query before, I have tried a couple of options but not sure what I am doing with it, 

I want it to limit but I need other fields, and so I must have something wrong here. I tried to put the select distinct and the columns needed but then it returned the full list again, so I knew that was wrong, so tried to select it in two rows but still not right, did try to find examples out on the web but no luck so back to you all

this was my last attempt and obviously wrong:

SELECT  dbo_claim_charges.charge_id, dbo_claim_charges.enc_id, dbo_claim_charges.create_timestamp,
SELECT DISTINCT dbo_claim_charges.claim_id,
FROM dbo_claim_charges;

thank you for help


---In, <pattykf@...> wrote :

I have  a table (I did not design it) that has a field called claim_id, charge_id, enc_id plus others

the claim_id and enc_id become duplicate rows due to charge_id having multiple charges on the same claim/encounter. How can I pull the data from this table where I would only get the claim_id/enc_id to show up unduplicated?

thank you 



Posted by:
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)



Tidak ada komentar:

Poskan Komentar