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. Generating Code in Dept-001/Fin.Year Format

Generating Code in Dept-001/Fin.Year Format

Scheduled Pinned Locked Moved Database
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.
  • V Offline
    V Offline
    Vinay Meka
    wrote on last edited by
    #1

    Hi guys., I had a kind of requirement where i will select my department in ddl and click on save button.,then the code should be saved in the format of selected department-S.no/Fin.Year. For Eg: If i select my Dept name as IT and my current financial year is

    2012-04-01 2013-03-31

    then output should be in the format of

    IT-00001 / 12-13
    (Dept-S.no/Fin.Year)

    if a save one more record then,

    output should be

    IT-00002 / 12-13

    If my Fin.Year changed to

    2013-04-01 2014-03-31

    then again the o/p should be

    IT-00001 / 13-14

    L M 2 Replies Last reply
    0
    • V Vinay Meka

      Hi guys., I had a kind of requirement where i will select my department in ddl and click on save button.,then the code should be saved in the format of selected department-S.no/Fin.Year. For Eg: If i select my Dept name as IT and my current financial year is

      2012-04-01 2013-03-31

      then output should be in the format of

      IT-00001 / 12-13
      (Dept-S.no/Fin.Year)

      if a save one more record then,

      output should be

      IT-00002 / 12-13

      If my Fin.Year changed to

      2013-04-01 2014-03-31

      then again the o/p should be

      IT-00001 / 13-14

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

      ..and what's your question?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

      1 Reply Last reply
      0
      • V Vinay Meka

        Hi guys., I had a kind of requirement where i will select my department in ddl and click on save button.,then the code should be saved in the format of selected department-S.no/Fin.Year. For Eg: If i select my Dept name as IT and my current financial year is

        2012-04-01 2013-03-31

        then output should be in the format of

        IT-00001 / 12-13
        (Dept-S.no/Fin.Year)

        if a save one more record then,

        output should be

        IT-00002 / 12-13

        If my Fin.Year changed to

        2013-04-01 2014-03-31

        then again the o/p should be

        IT-00001 / 13-14

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        As Eddy said, you really should ask a question you want answered rather than state a problem. Try looking into string concatenation, you are going to have to CAST or CONVERT the datetime and int into varchar values and concatenate them!

        Never underestimate the power of human stupidity RAH

        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