Need access expert

kashif.special2005

Active Member
Joined
Oct 26, 2009
Messages
443
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
I want below like out put in MS-ACCESS<o:p></o:p>
<o:p> </o:p>
Name OutPut<o:p></o:p>
Kashif 1<o:p></o:p>
Kashif 2<o:p></o:p>
Michael 1<o:p></o:p>
Kashif 3<o:p></o:p>
Michael 2<o:p></o:p>
Derek 1<o:p></o:p>
Derek 2<o:p></o:p>
Kashif 4<o:p></o:p>
<o:p> </o:p>
In excel I will apply this formula =COUNTIF($A$2:A2,A2), how can I get this result in MS-ACCESS.<o:p></o:p>
<o:p> </o:p>
Thanks,<o:p></o:p>
Kashif.<o:p></o:p>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You need a subquery.

This example is based on tblPeople with these fields:
NameID (Autonumber, Primary Key)
Person (Text)

Code:
SELECT tblPeople.NameID
, tblPeople.Person
, (SELECT COUNT(*) FROM tblPeople AS T WHERE T.NameID<=tblPeople.NameID AND T.Person=tblPeople.Person) AS Tally
FROM tblPeople;

Denis
 
Upvote 0
Thanks for reply but query is not working as I want

<TABLE cellSpacing=0 bgColor=#ffffff border=1><CAPTION>Name_Table</CAPTION><THEAD><TR><TH borderColor=#000000 bgColor=#c0c0c0>Name</TH><TH borderColor=#000000 bgColor=#c0c0c0>OutPut</TH></TR></THEAD><TBODY><TR vAlign=top><TD borderColor=#c0c0c0>Kashif</TD><TD borderColor=#c0c0c0 align=right>1</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Mahvish</TD><TD borderColor=#c0c0c0 align=right>1</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Kashif</TD><TD borderColor=#c0c0c0 align=right>2</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Mahvish</TD><TD borderColor=#c0c0c0 align=right>2</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Kashif</TD><TD borderColor=#c0c0c0 align=right>3</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Derek</TD><TD borderColor=#c0c0c0 align=right>1</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Kashif</TD><TD borderColor=#c0c0c0 align=right>4</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Derek</TD><TD borderColor=#c0c0c0 align=right>2</TD></TR><TR vAlign=top><TD borderColor=#c0c0c0>Vishal</TD><TD borderColor=#c0c0c0 align=right>1</TD></TR></TBODY><TFOOT></TFOOT></TABLE>

I want result as above I have only Name column in a table.

Thanks & Regards,
Kashif.
 
Upvote 0
You will need to add an ID field for the query to work, otherwise Access won't be able to determine the correct order for the records. As a general rule every table needs a primary key field. I almost always use an Autonumber for the primary key.

Denis
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top