How to find the max value of a column in Excel 2007
-
Tuesday, May 08, 2012 4:18 AM
I Have a Column "Id" in my excell sheet "MAY".
I want to find the maximum value of that column.
i am using the query
Select max(Id) as ID from [MAY$];
but this query only fetches the max value as 9 where as the maximum value in my column is 13.
The Format of the column is General.
All Replies
-
Tuesday, May 08, 2012 4:38 AMhi,
try this one :
http://www.excelforum.com/excel-programming/748138-sql-max-id-return.htmlPeter Koueik
-
Tuesday, May 08, 2012 5:03 AM
link does not work
-
Tuesday, May 08, 2012 5:27 AM
above link is working fine here is d text of link,
hi i need to be able to find the value of the maximum ID in a table i have using VBA. played around with a few variations but none of them seem to wok. Generally they return Syntax errors though i have tried a number of suggestions from a buch of sources.
rst.Open "Select MAX(ID) FROM Package", conn, adOpenDynamic, adLockOptimistic,adCmdTextSheets("New Package").Range("B13").CopyFromRecordset rst maxi = Range("B13").Value + 1 rst.Close rst.Open "package", conn, adOpenDynamic, adLockOptimistic, adCmdTable
Thanks!-- Thanks, Amit kala Please remember to click “Mark as Answer” on the post that helps you, & to click “Unmark as Answer” if a marked post does not actually answer your question.
-
Tuesday, May 08, 2012 5:58 AM
hi there,above link is working fine here is d text of link,
hi i need to be able to find the value of the maximum ID in a table i have using VBA. played around with a few variations but none of them seem to wok. Generally they return Syntax errors though i have tried a number of suggestions from a buch of sources.
rst.Open "Select MAX(ID) FROM Package", conn, adOpenDynamic, adLockOptimistic,adCmdTextSheets("New Package").Range("B13").CopyFromRecordset rst maxi = Range("B13").Value + 1 rst.Close rst.Open "package", conn, adOpenDynamic, adLockOptimistic, adCmdTable
Thanks!
-- Thanks, Amit kala Please remember to click “Mark as Answer” on the post that helps you, & to click “Unmark as Answer” if a marked post does not actually answer your question.
even though this is a C# general forum
http://www.ozgrid.com/forum/showthread.php?t=53132
Peter Koueik
- Edited by Peter Koueik Tuesday, May 08, 2012 5:59 AM
- Marked As Answer by Lisa ZhuMicrosoft Contingent Staff, Moderator Thursday, May 10, 2012 6:52 AM

