Apr 30, 2004 #1 pgoulet IS-IT--Management Dec 9, 2002 45 US Is it possible to select the max value -1? Thanks in advance.
May 1, 2004 #2 jrbarnett Programmer Jul 20, 2001 9,645 GB If you mean you want to subtract 1 from the maximum value: select max (fieldname)-1 as fieldnameMinus1 from table If you mean you want the second from top record in a field: select top 2 fieldname from table order by fieldname desc and ignore the second line in your code. John Upvote 0 Downvote
If you mean you want to subtract 1 from the maximum value: select max (fieldname)-1 as fieldnameMinus1 from table If you mean you want the second from top record in a field: select top 2 fieldname from table order by fieldname desc and ignore the second line in your code. John
May 1, 2004 Thread starter #3 pgoulet IS-IT--Management Dec 9, 2002 45 US Wow, I certainly need to read up on how to ask a good question. If you take a sorted list... a,b,c,d,e,f, and you wanted to get ONLY the value of max-1 or max-2, is there a way to do that? Meaning select e, or d respectively. Thanks. Upvote 0 Downvote
Wow, I certainly need to read up on how to ask a good question. If you take a sorted list... a,b,c,d,e,f, and you wanted to get ONLY the value of max-1 or max-2, is there a way to do that? Meaning select e, or d respectively. Thanks.