Get max value in access or sql

Total Post:33


 2574  View(s)
Rate this:
How to get Max value in Access or sql...???

column Name     :- receipt_no
column datatype :- nvarchar

receipt_no value is 1 to 1945

I am trying but result is wrong...
every time return 999(because 9 is grater than 0 to 9 for ascii reason )...

Thanks & regards
Manmohan Jha
  1. Re: Get max value in access or sql

    You need to convert your nvarchar datatype to int before calling max function. The working query given below:

    Select max(Convert(int,receipt_no)) From Receipt

  1. Re: Get max value in access or sql

    I use this query multiple time, but not work in access
    i also use:-
    Select max(Cast(receipt_no as int)) From Receipt

    Both not working in access db

      Modified On Apr-04-2018 05:20:16 AM
  1. Re: Get max value in access or sql

    I've solved this myself...

    Access Query is :- SELECT Max(Val(receipt_no)) AS rcptno FROM Receipt


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.