Query in Access 2007

I have linked via ODBC tables from another database.  I have created a query 
to pull in two columns of information from the two tables in the query.  I 
would like to add an extra column that is only created when the query is run, 
to dynamically number each row incrementally, depending on how many rows the 
query returns.  If it returns 10 rows, then the first column should be 
numbered 1 to 10, if it returns 357 rows, then the rows should automatically 
incrementally number each from from 1 to 357. 
0
Utf
2/20/2008 11:15:02 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
1106 Views

Similar Articles

[PageSpeed] 21

Try this but substitute your table and field names.  Prim is your primary 
key.  This can only be viewed in SQL view.
SELECT a.Column1, (COUNT(*)) AS Row
FROM [YourTable-4] AS a LEFT JOIN [YourTable-4] AS b ON a.Prim>=b.Prim
GROUP BY a.Column1;

-- 
KARL DEWEY
Build a little - Test a little


"ShelleyS" wrote:

> I have linked via ODBC tables from another database.  I have created a query 
> to pull in two columns of information from the two tables in the query.  I 
> would like to add an extra column that is only created when the query is run, 
> to dynamically number each row incrementally, depending on how many rows the 
> query returns.  If it returns 10 rows, then the first column should be 
> numbered 1 to 10, if it returns 357 rows, then the rows should automatically 
> incrementally number each from from 1 to 357. 
0
Utf
2/20/2008 11:43:00 PM
Reply:

Similar Artilces:

Access 97 can't resize database window
My database window with the listings of forms tables etc was adjusted to a smaller width, but resizing it is completely disabled and renders Access 2007 utterly useless for me. Is there anyway to 'reset' the window? ...

How to link with an Access DB
Hi, I have an Acces DB with many tables. I need to choose the name of a customer in a cell of Excel. For example, in acces I have this tables: Table1 Id Name Last Name City I need to choose the last name from a drop down menu in a spreadsheet and then in other cell I need to put all the data regarding the last name that I choose. I hope to be exaustive, and sorry for my english. :-) Many Thanks Stefano ...

Accessing Windows Office Templates
There are some very nice templates at the Windows Office Template Gallery. I would like to download (mostly Word, but a few Excel) some of these templates, but the format comes out with a ".cab" extension that Office v.X doesn't understand. Is there any way to get these templates? Unfortunately, they make the Mac template archive look very weak. TIA Len Hi Len, Microsoft has a Mac template download page: http://www.microsoft.com/mac/resources/templates.aspx?pid=templates There's a link to the on-line gallery on that page. It looks like a newly re-designed gallery to m...

Access 2003 resets form variables during debugging while the form is open
Hello, I am using MS Access 2003. (FWIW, this is about an ADP project, not MDB.) A form has a variable that is initialized (by some function call) in Form_Load() and then stays unchanged for the form's entire lifetime. (In a language more advanced than VBA, it would be a constant, not a variable; unfortunately, in VBA I cannot initialize a constant by non- constant expression). Specifically, in my case it looks like this: Private sTempFileName as String ... Private Sub Form_Load() ... sTempFileName = GenerateTempFileName(...) ... End Sub Priv...

OWA. CA's. and Exchange 2007
The other day, I had to renew the Certificate on my Exchange 2007 server. Everything seemed to go alright, but eventually I received complaints that outbound email wasn't being sent. Looking at EMC showed all of the email queued up and waiting for something. After I relaxed the settings on my router (Allowed all outbound SMTP instead of restricting it to the Exchange server sending to MxLogic) all of the outbound email went though. I also was receiving reports of Webmail being broken (which was halfway fixed with the help of http://www.microsoft.com/technet/support/ee/transform.aspx?Pr...

How do I get Powerpoint 2003 fade in 1 by 1 in 2007
I frequently used the 'fade in one by one' feature in Powerpoint 2003, which allowed me to fade in individual bullet points by way of a click of a mouse. Not only is this feature now not standard in 2007, but I can't work out how to create it: anything that I find, tends, instead, to fade the bullet points in on some kind of automatic time schedule, rather than - as I want - on a mouse click. I want only to use text, no sounds, no pictures, and nothing fancy. Currently, I am reduced to copying my material into an old Powerpoint 2003 presentation, but this is silly....

Office 2007 forms
I am creating a form with office 2007, will those people who do not use office 2007 be able to fill in my form? should I save it in a particular format? thanks Provided you start from the normal template, don't use fonts that were introduced with Word 2007, and save the form in Word 97-2003 document format, anyone with Word 97 or later should be able to open it. Use only the legacy form fields, to which end http://gregmaxey.mvps.org/Classic%20Form%20Controls.htm will make things easier. -- <>>< ><<> ><<> <>>< ><<...

Outlook 2007 addresses
How can I find the list of addresses I have sent emails to? When you start a new email you can put a letter in the To line and list will come up. Where is that list? How can I print it out? Thanks Matt that is the autocomplete cache. You would need a utility to print it out. http://www.outlook-tips.net/archives/2004/20040621.htm http://www.slipstick.com/problems/nicknamecache.asp -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Out...

Using later version of microsoft access
Hi, I've got access 2000 on my computer. When I go to open a database someone sent me I get an error message : this database is in an unrecognized format. The database may have been created with a later version of microsoft access. Is there any way I can open and use this file (short of upgrading to later version of access)? If you do not have Access 2002 or 2003, ask the person to save it in Access 2000 format for you. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at m...

Outlook 2007 Install gone wrong
We recently switched e-mail hosts and I successfully (mostly) switched over my company's accounts from a POP server to our new IMAP server. But I'm trying to set up one more account and am running into issues. I put in all the same settings as for our other accounts, but it won't allow me to create or copy any sub-folders into the InBox folder for this account (it tells me it cannot and this is "probably due to a limitation of your imap server")...but I can do so for the other accounts on the same server. Also, when I try to view the Imap Folders, it says "The...

users with restricted access
We have some users that we have directed to only get their information from a report that has been set up. Because of that, I set up a parameter query to make the information more easy to see. The parameter query prompts for last name or broker #, is there a way, when the last name is entered to include Jr's & Sr's? Or should this be another field in the table to make the last name field more accurate? ...

Access 97/2000/2003 comparisons
I have a rather large application that uses an access 97 database (DAO). We also have a version that works with access 2000, Oracle, msde, and SQLServer (ADO). We would like to retire the DAO version of the product, but there are places where the ADO version is much slower compared to where we run DAO seeks (very noticeable when looping). So, I have a few questions. 1. Are there any tips/tricks to speed up ADO queries to compare with DAO seeks? 2. Would there be any benifit in using access 2003 over previous versions of the software besides the added features (xml support, etc). 3...

Queries and Charts
Does anyone know why the expressions in queries work fine for reports but not charts? ...

no access to send internet email
Hi, Exchange 2003. Can a mail enabled user be restricted to send internal email only and not internet email? Nich Hello, > Exchange 2003. Can a mail enabled user be restricted to send internal email > only and not internet email? yes, that is possible. There are multiple ways to archive this goal. Depents on your infrastructure,too. If you have mailing to external over an SMTP Connector, try this: First look into your SMTP Connector, you will find Delivery Restrictions there. It is self explaining. If you have trouble with that or you won't find it, then i will need additi...

Changing query execution sequence
Hi all, I got a spreadsheet which would execute a bunch of queries. It's noted that the queries are executing in the sequence of when it was added to the spreadsheet. Does anyone out there know of a way to switch the order without deleting and recreating them? Thanks! Wing ...

Pass parameter from FORM to QUERY
I have an append query that I trying to call from a cmd btn...but it prompts me for the parameter(ie QuoteID)... How do I tye it into my call: Dim stQueName As String stQueName = "Quote Query" DoCmd.OpenQuery stQueName, acNormal, acEdit On Apr 13, 12:56 pm, jlt...@hotmail.com wrote: > I have an append query that I trying to call from a cmd btn...but it > prompts me for the parameter(ie QuoteID)... > How do I tye it into my call: > > Dim stQueName As String > stQueName = "Quote Query" > DoCmd.OpenQuery stQueName, acNormal, acEd...

Excel 2007 PC damages Mac Excel 2008 Files
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel When I open a Mac Excel 2008 file on Excel 2007 and I can work with the file, however when the file is returned to the Mac, it no longer works correctly, leading to a crash as soon as I try to save or eventually it might change the file to look like a bunch of letters and characters. Here is the error report: <br><br>Microsoft Error Reporting log version: 2.0 <br><br>Error Signature: <br> Exception: EXC_BAD_ACCESS <br> Date/Time: 2010-01-15 17:05:56 -0600 <br> Application N...

Installed Font does not display in Word 2007
Only 6 of of 8 recently installed TTF fonts will display in Word 2007 Are the missing ones variants like Italic or Bold? On Dec 25, 1:28=A0pm, GWHA <G...@discussions.microsoft.com> wrote: > Only 6 of of 8 recently installed TTF fonts will display in Word 2007 ...

multiple iterations of same query
Running Access 2003 on Vista. I have a query that chooses 15 records at random. This works fine. What I want to do is run the same query for approx 110 different users, each with their own randomly selected 15 records. Obviously, I want to avoid manually running the same query that many times. How can I get around this? Post your query SQL. -- Build a little, test a little. "Nathan" wrote: > Running Access 2003 on Vista. > > I have a query that chooses 15 records at random. This works fine. > > What I want to do is run the same query fo...

Share Calender in Outlook 2007
In our organization, we have changed the the default data file path. This makes the "Share a Calender" option disappear. First of all, is there any anything to work around this? Secondly, if there is nothing that can be done in the above case, I tried sharing the calender by publishing it in Office Online. Apparently the calender is shared but when I sent it to my colleague's work e-mail address, he is unable to access it. It asks for authentication and cannot contact the web server when he enters his credentials. How to make this work? I don't want to go sharing my W...

Excel 2007 Line Chart
Hello, Is it possible to configure a line chart in Excel 2007 to ignore the intervals and graph straight to the next value. For example if I have the periods: Jan with the value 1000 Feb with the value 900 March with the value 500 April with the value 0 May with the value 0 June with the value 0 I want the March value to drop directly from 500 to 0 ignoring the interval to April, I do not want a curved line it must drop directly to zero then the line is straight across to April. I have no idea if this is possible, any ideas? Thanks, Brett On Tue, 11 Oct 2011 15:40:45 -0700 (PDT), TyreDu...

upgrading from Access 97 to Access 2007
I designed a database (forms, reports, et al) several years ago in Access 97 and it continues to work well. I've just received a MS Office Professional 2007 and wonder if it is time to migrate my data into the new program. I've attempted two or three times to do this in Access 2002 and I keep getting error messages along the line of "...corrupted file..cannot be opened by Access 2002 (or some such message)..." The help radio button opens up a box which suggests I do some programming in Virtual Basic to perform my transfer task. The easy way out, of course, is to sti...

How to show query parameters on an Excel page header or worksheet?
Is it possible to display query parameters on a page header or on a worksheet? I have a worksheet that uses a query to retrive data from an ODBC database. The Query prompts for the Start Date and End Date. I would like to be able to print the worksheet and display the Start Date and End Date the user typed in. Thank you for your assistance. ...

Money deluxe 2007 password problem
When I update my bank account transactions I get a message saying that my account was not updated because my password is incorrect. I then go into account info and have to update my password. I save the update, but then it happens again sporadically when I open Money at later times. Is there a way to fix this glitch? ...

Excel and Access
Hi All, I admit I am a complete novice on this aspect of using Excel. My requirement is as follows. I have an Access Database called nt1.mdb on drive D: in which there is one table (Table1) of data, indexed on column1 I wish to connect to this database and search the contents of Table1 for a value in column1 that has been entered into an Excel userform. The values of the other columns in Table1 should be returned if the value is found. How do I connect to the mdb, do the search and read the resulting values from the table? Any help gratefully received. Cheers There's sample ...