103
Views
2
Comments
SQL function MAX
Question

Hello.

I'm trying to do an Advanced SQL query using MAX function and TOP something like these;
SELECT MAX({Table1}.[Id])
FROM {Table1}

and i also tried

SELECT TOP 1 {Table1}.[Id]
FROM {Table1}
ORDER BY {Table1}.[Id] DESC

With no success. > https://img132.imageshack.us/img132/7834/functionmax.png

Is there another way to get the max value using simple query ? Or can anyone give me a tip, what i'm doing wrong...

2011-08-23 22-04-05
Tiago Simões
Staff
Hi António,

I believe you need to change the advanced query output structure to a structure with a singe Integer attribute:



Cheers,
Tiago Simões 
2023-01-29 21-43-42
António Rodrigues
Hi Tiago,

Thanks for the tip, problem solved!

Best Regards,

A.R.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.