I have one excel file in that I need to get top5 highest values (based on column vaues)into one sheet and top5 lowest values in to one sheet(I need all columns)? Tell me how to write sql query for this. FYI attaching the excel file.(based on CHNG column need to get this top 5 highest and top 5lowest)
About excel as a database queries
Hi @RAJASIMHA SALLAGUNDLA ,
Could you check if this logic provides the expected output?
SELECT TOP 5 * FROM [Sheet1$$]
ORDER BY [chng] DESC;
Kind Regards,
Ashwin A.K
Hi Ashwin,
I tried same logic,its giving result but not giving highest CHNG values in descending order. But its giving random values.
Try:
SELECT TOP 5 * FROM [Sheet1$$]
ORDER BY CDbl([chng]) DESC;
Hi Aswin, instead of excel as database , using loops and if conditions how we gonna get this..
No it's not working.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.