sql - SQLstatements returns different values in MS Access & MSSQL -


i trying write sqlstatement return max value table. works in sql server, microsoft access sorts values based on first number (and not number whole) returning wrong tuple.

select top 1 [currency code], [relational exch_ rate amount] [cronus sverige ab$currency exchange rate] order [relational exch_ rate amount] desc 

so correct answer should return: gbp | 1354.xxx

and in access get: hkd | 97.xxx

i have tried

select [currency code], max([relational exch_ rate amount]) [cronus sverige ab$currency exchange rate] 

it works max(columnname), when add [currency code] in front/after returns wrong value.

edit: seems access sorting numerical value letters rather actual numbers. tried find way change - without results. input appreciated.

selecting top 1 after grouping , ordering should want

select top 1 [currency code], max([relational exch_ rate amount]) [cronus sverige ab$currency exchange rate] group [currency code] order max([relational exch_ rate amount]) desc 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -