3 top invoices per day

G

Guest

hello all,

I tried in all possible ways, but I can't find a solution...
I've got 1 table with 2 fields only : Invoice number, Invoice Date.
I wish to retrieve the first 3 invoice numbers per Invoice Date.

I checked on the Discussion groups, but the proposed solutions use 3 fields,
and I only have 2.
Can someone help me on this ?
Thanks in advance
 
G

Guest

Try something like

Select T1.DateField , T1.InVoiceField From TableName As T1
Where T1.InvoiceField In (Select Top 3 T2.InvoiceField Where T2.DateField =
T1.DateField)

********
Note: you need to change the field names
T1 And T2 refer to the same table
 
G

Guest

GREAAAAT ! Finally it works.
Thanks a lot for your help.

However I had to update your code from :
In (Select Top 3 T2.InvoiceField Where T2.DateField
to In (Select Top 3 T2.InvoiceField From TableName As T2 Where T2.DateField

Thanks again for this quick answer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top