last row or record

there is no ID in this table.
table1:
col1  col2   col3
-----   ------   -----
aaa   bbb   ddd
aab   jjj      fff
ccc   qqq   ppp

like to get this output:
col1  col2  col3
-----   ------   -----
ccc   qqq   ppp

-- 
Message posted via http://www.accessmonster.com

0
igg
2/3/2010 7:34:26 AM
access.queries 6343 articles. 1 followers. Follow

2 Replies
523 Views

Similar Articles

[PageSpeed] 3

sorry to buttoning in between...

try this...

create form using table, and in form on load properties.

 DoCmd.GoToRecord , , acLast

regards 



"igg via AccessMonster.com" wrote:

> there is no ID in this table.
> table1:
> col1  col2   col3
> -----   ------   -----
> aaa   bbb   ddd
> aab   jjj      fff
> ccc   qqq   ppp
> 
> like to get this output:
> col1  col2  col3
> -----   ------   -----
> ccc   qqq   ppp
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> .
> 
0
Utf
2/3/2010 9:56:01 AM
Unless there is something in the data that tells you which record is the LAST 
record you are out of luck.  Records are unordered when they are stored in the 
database.

Perhaps you can get what you want with a totals (aggregate) query that uses 
the LAST operator.

SELECT Last(Col1), Last(Col2), Last(Col3)
FROM [YourTable]

That will return the last record retrieved by the query, which is often (not 
always) the last record entered into the table.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

igg via AccessMonster.com wrote:
> there is no ID in this table.
> table1:
> col1  col2   col3
> -----   ------   -----
> aaa   bbb   ddd
> aab   jjj      fff
> ccc   qqq   ppp
> 
> like to get this output:
> col1  col2  col3
> -----   ------   -----
> ccc   qqq   ppp
> 
0
John
2/3/2010 12:40:45 PM
Reply:

Similar Artilces:

Formula for formatting rows and columns minimizing the outcome.
I am using Excel 2007. I have 3 columns A, B, and C such as below: TU10-10 TU10 Tungsten Satin Wedding Band TU10-10.5 TU10 Tungsten Satin Wedding Band TU10-11 TU10 Tungsten Satin Wedding Band TU10-11.5 TU10 Tungsten Satin Wedding Band TU10-12 TU10 Tungsten Satin Wedding Band TU10-12.5 TU10 Tungsten Satin Wedding Band TU10-13 TU10 Tungsten Satin Wedding Band TU10-6 TU10 Tungsten Satin Wedding Band TU10-6.5 TU10 Tungsten Satin Wedding Band TU10-7 TU10 Tungsten Satin Wedding Band TU10-7.5 TU10 Tungsten Satin Wedding Band TU10-8 TU10 Tungsten Satin Wedding Band TU10-8.5 TU10 Tung...

How do I advance the range by one row Excell VBA automatically #2
I am using Sheets(Array("Breakfast", "Lunch", "Supper", "Bedtime")).Select Range("B94:D98").Select but when I run this more than once it overwrites what was put in the first time. ...

Checking for duplication on rows
Hello, In a particular spreadsheet, I would like to verify if the same name is listed on multiple rows. The name is entered in multiple columns on the same row, that is acceptable, but I would like to know if the name is entered on multiple rows regardless of the column. How can I check this? THANKS, karmen -- Karmen ------------------------------------------------------------------------ Karmen's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30972 View this thread: http://www.excelforum.com/showthread.php?threadid=509495 Presume you're checking some...

CRM 3.0 installation failed on reporting services installation last step
CRM 3.0 installation failed again at last step of installing reporting services. it only says unexpected error occured and error code is 25616. is there a recommended way of CRm 3.0 install? i meant to say that is it preffered to install reporting service seperatly ??? now what i should do with the installation? should i need to prepare the machine again for re-installation? this installation is not helpful as it did not tell any detail error and it says every thing ok on Pre req verification. One further thing i encountered after 25616 error that it displayed me a Message to Retry Abort or ...

Autocomplete email domain from previous record
Hi All, I have a form with an email address field in which the domain is often the same for each new record. For example, test@domain.com... the "@domain.com" portion is often the same. What I would like to do is somehow have some code that autocompletes just the domain portion from the previous record when the user types the "@" symbol. So, they can then type in "test2" and as soon as they hit the @ symbol it would complete the field with the domain portion from the previous record. Does anyone have a genius way to do this? :-) Thank you for your help!...

Keeping Row 1 At Top When Scrolling?
How do i make it so that the top row, row 1, stays at the top of my sheet no matter how far i scroll down the page? Many thanks Kev. Kev, Select cell A2 and then go to the Window menu and choose Freeze Panes. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com chip@cpearson.com "KMc" <mcauley@ourgeneration.freeserve.co.uk> wrote in message news:bf0re3$uoe$1@newsg4.svr.pol.co.uk... > How do i make it so that the top row, row 1, stays at the top of my sheet no > matter how far i scroll down the page? > > Ma...

Count Rows When Using Auto-Filter
Using the auto-filter function I need to count the number of rows returned each time I select a new value. I can do a COUNTA (&#8211;1 to allow for the header row), on the column that counts all the rows but when I use the filter I still get the total count not a count of the reduced quantity by the filter. Can anyone help? Nick use the subtotal function with a first argument of 3 =subtotal(3,A2:A300) as an example. Make sure the column you do the counta on will have values in all rows. -- regards, Tom Ogilvy "Nick" <ner@westnet.com.au> wrote in message news:15...

Ranking/Sorting more than 3 row's
I have a spreadsheet with 742 rows (of company names). I have 5 columns of criteria for the companies. Each column is a different criteria about each company, and has a numerical rank for each company. 1-~75 (some columns/criteria have no rank for a company) I want to create an overall rank of the companies based on how they perform across the 5 rows. I want the companies with the most 1's at the top and then those with 1 & 2's and then those with 2 & 2's etc. Is there a way to sort or rank this spreadsheet of companies? I would do a sum of the inverses of each of...

I can't edit existing records, only add new
I created a form with the intent of being an 'add new contact' form. Well, I want to reuse the form as an edit/update contact form also. The problem is, I can't view any existing records. I have allow edits, deletions, additions enabled. Record locks = no locks. Record selector and navigation buttons = yes. What am i missing? Data Entry property Regards Jeff Boyce Microsoft Office/Access MVP "MeSteve" <MeSteve@discussions.microsoft.com> wrote in message news:11129652-032B-4966-80CC-7AAD8E18162C@microsoft.com... >I created a form with the intent of ...

Re-assign the records from one user to another
Hello, I know that it should be option to re-assign the records on the 'User Definition' screen (under Actions), but when I go into this screen with the SysAdmin role, I don't have this option. Any ideas? Regards, Inna. ...

Time Stamping
I like to always know when a particular entry was made. So if I have a new contact, I can have some automatic process whereby when I hit "SAVE" it will put a date somewhere . Along those lines -- keeping the information regarding when I sent and when they sent a message last is important. but it isn't included in the DB or .vcf - I have to reload my 2200 contacts from time-to-time and when I do, that data is lost. Is there another way to ensure that I can keep this data? TIA Bruce' Using Office 2008 ...

Hidden Rows
I came accros a spreasheet were the first 8 rows are hidden. I can select and edit the cells by entering the cell reference into th Name Box. But I cannot make them visible - the rows have a height o 15. And selecting all the cells then selecting unhide does not work. Protection has not been applied. Does anyone have any ideas on how this was done? and how can I mak them visible? Thanks -- michael.a ----------------------------------------------------------------------- michael.a7's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3302 View this thread: http:...

Calculating a value for a new record
I have a simple database which records a list of different reports my team produces. Each report has a unique hopefully sequential number "Report No" which is different to the "Record ID" (Autonumber). I have a form which I am using to add new reports to the underlying table. As I add a new report record I want to look up the highest existing Report No value in the table and auto populate the New Report Form Report No Control with that number +1. i.e. if the last report added was numbered 255 the next one shoiuld be 256. I have tried using Max ([Current ...

How to open a blank form for adding a new record
Hello, I have a form for adding/viewing employee records. I can open the form, view records and using the navigation button, add a new record just fine. However, I'd like to open the form using a command button so that all fields are blank and a new record can immediately been added without having to use the navigation button. Can anyone help me figure out how to do this? TIA, Rich On Tue, 13 Nov 2007 13:20:02 -0800, rich wrote: > Hello, > > I have a form for adding/viewing employee records. I can open the form, > view records and using the navigation button, add a...

last sheet or go back
I have been trying to figure out how to go back to the last sheet that I was working on. I often navigate my spreadsheets with hyperlinks, but I haven't figured out how to go back to the sheet I was last on. Any help would be great. By the way, what is up with all of these weird posts that we have been inundated with lately? Regards, Shane > By the way, what is up with all of these weird posts that we have been > inundated with lately? Some nutter sends them out now and then - probably trying to get into the top-10 posters lists !! Pete How about a navigation bar from Debr...

Insert row, table to table
Hi, As I cannot use INSERT INTO with values specified to WHERE. I have created an interim temporary table where the record contains two text strings.Now I want to be able to take those text strings and append to the correct table where the record is set by an ID number. First_Name = Fred Last_Name = Jones Its a new contact so it is too be added to a customer with an ID = 1375 Now I can't use the following sql statement strsql = "INSERT INTO [tblCUSTCONTACTS] ( [FIRST_NAME], [LAST_NAME] ) " _ & " VALUES (""" & strFirst & "&...

Switch row with column?
Hello guys, im very new to excel, and im trying to learn. I cant seem to figure out how to switch my chart around. I have a list of companies on the top, and down the left i have a list of locations. How can i make the locations go on top, and the companies down the left? -- jason57gizmo ------------------------------------------------------------------------ jason57gizmo's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30700 View this thread: http://www.excelforum.com/showthread.php?threadid=503627 Depending on the number of rows you're using--since t...

Update Several Records with separate table data
I have two tables. One has all fields complete. The other has some complete records, but most only have one field completed. I want to input the complete records to the incomplete table, merging any records that would be duplicated. I forgot to mention this in my first post. Why are you duplicating data in your database? The goal of a well designed database is to only store the same piece of information once. Dale -- Email address is not valid. Please reply to newsgroup only. "Dale Fye" wrote: > In Access (am unsure whether A2007 supports this), you can do this as a ...

Help with counting rows
I have a datafeed that comes to me everyday via email , every day the feed had slighty different rows as it has different updated products i.e. somedays 999 , 1001 etc. What i need to do is run a macro so when the excel file arrives to count the number of rows and then add the letter "y" in a 3 new columns . At the moment i have to do it manually is this easy to do Paul iLastRow = Range("A1").End(xlDown) Range("B1").Resize(iLastRow,3).Value = "y" -- HTH Bob Phillips (remove nothere from email address if mailing direct) <plm11111@h...

Create a duplicate record
I use a form to input the data into the table. From time to time, I need to create a duplicate record from previous records or just completed new record. I saw the previous articles here but most of them to copy the last record to a new record. However, I need to highlight the desired record and copy to a new record. Any guidance and example are appreciated. Thanks, Scott Here's one that lets you duplicate the record in a form, as well as any related records in the subform: http://allenbrowne.com/ser-57.html Just ignore the part about the subform, and use the rest. -- ...

Query Does Not Count "2" Records
Good Evening Everyone... I have a bit of a logical puzzle that I need to solve. I have various queries which have various criteria for them. One query involves retirees or spouses being under the age of 65 and the other involves retirees or spouses being over the age of 65. Both the retiree and spouse are listen in the same records and on one line of the master table and queries. The situation that I am running into is that I can have a retiree who is over 65 and a spouse under 65 and the record comes up twice in the two different queries b/c it meets the criteria, which is perfect. What...

Insert blank rows
Rather than using the control button to select every other row, which can be very time consuming when you have more than 100 rows, I am trying to figure out how to auto-insert blank rows between pre-populated rows of information. Deb, Try this macro. ALT+F11 to open VB editor. Right click 'ThisWorkbook' and insert module and paste the code in on the right . Change the sheet name to your sheet and run the code Sub insert_rows() Dim ws As Worksheet, x as long Set ws = Sheets("Sheet3") lastrow = ws.Cells(Cells.Rows.Count, "A").End(xlUp).Row For x = ...

Insert a row based on a macro
Is there a way to insert a row based on a formula. For example, If A5=25, I then want to duplicate the existing row and insert it in the line below. See answers in your other post. Pls don't multi post -- Don Guillett SalesAid Software donaldb@281.com "Mindie" <Mindie@discussions.microsoft.com> wrote in message news:75A1DDD5-6334-410D-8646-091B43D1B198@microsoft.com... > Is there a way to insert a row based on a formula. For example, If A5=25, I > then want to duplicate the existing row and insert it in the line below. ...

Calculate difference in rows in a query
I have a query that calculates how much revenue is claimed by month per job but then I have to take the new month less the prior month. The problem is the data is in row format. I don't know how to subtract February from January, March from but don't know how. I know how to do it in Excel but not Access. Please help... Example: Order Month JTD Clm Variance 101026521 January $511,525 $0 101026521 February $511,525 $0 101029438 January $1,238 $0 101029438 February $3,713 $2,475 101033168 January $21,465 $0 101033168 February $51,460 $29,995 101034011 Janu...

Offset, sum down to the first blank row
can anyone write the formula to sum down to the first blank row it encounters? In the sample data below I want the xx to sum only to 60 Assume the word sum is in cell A1 and the xx is in cell B1. sum xx Blue 10 Black 20 Red 30 Red 20 black 40 thanks much. p.s. would this formula be considered "volatile" and therefore "risky"....if so, what's the risk. thx. "Tami" <Tami@discussions.microsoft.com> wrote in message news:EFA4F8A3-A823-4522-A946-F55AB55E0B29@microsoft.com... > can anyone write the formula to ...