Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Max function on varchar value

Max function on varchar value

Scheduled Pinned Locked Moved Database
databasehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nikhil Bhivgade
    wrote on last edited by
    #1

    in my table i am entering values like A/101/2010,A/102/2010.......A/1000/2010 after this value when i use MAx() function which return me A/999/2010 now i need the query which should return this value 'A/1000/2010' and on words plz help me out.....

    T L 2 Replies Last reply
    0
    • N Nikhil Bhivgade

      in my table i am entering values like A/101/2010,A/102/2010.......A/1000/2010 after this value when i use MAx() function which return me A/999/2010 now i need the query which should return this value 'A/1000/2010' and on words plz help me out.....

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      You should write an user defined function for your issue because the values which you are storing are not number data type. Also you need to sort the records based on year which is last 4 chars in your sample value. So write an UDF.

      thatraja


      Tips/Tricks|Brainbench certifications|Facebook|Twitter

      1 Reply Last reply
      0
      • N Nikhil Bhivgade

        in my table i am entering values like A/101/2010,A/102/2010.......A/1000/2010 after this value when i use MAx() function which return me A/999/2010 now i need the query which should return this value 'A/1000/2010' and on words plz help me out.....

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Nikhil Bhivgade wrote:

        A/101/2010

        That looks like three values to me. How about splitting them over different columns? That way you could easily SORT the values any way you'd want :)

        I are Troll :suss:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups