Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Identifying the last observation in a group

Author  Topic 

monayme
Starting Member

1 Post

Posted - 2006-06-27 : 06:46:34
I am trying to identify the last observation in a group. If you are familiar with SAS, then the equivalent SAS code is LAST.varname. I'd like to tag it as LAST while the others should be OTHERS.

How do you do this in SQL? Thanks!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-18 : 06:42:25
What is "last"? Last by time? Last by alphabet?



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-18 : 11:43:44
I think MSAccess has First and Last function. If that doesnt give the answer you want, post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-22 : 01:07:07
Without an ORDER BY, First or Last picks the record in physical order in the database.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -