incremental ID resetting each month

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • drrajnishpatel via AccessMonster.com

    incremental ID resetting each month

    i am trying to get "ID" an incremental number that simply resets to 1 each
    month in my "table1" thanks,

    --
    Message posted via AccessMonster.c om


  • bhicks11 via AccessMonster.com

    #2
    Re: incremental ID resetting each month

    The day() function gives you the day of the month. Use it to get your number.


    Bonnie
    Data entry services, data entry and database programming services since 1992. Security, accuracy, and reasonable pricing. (678) 773-6504


    drrajnishpatel wrote:
    >i am trying to get "ID" an incremental number that simply resets to 1 each
    >month in my "table1" thanks,
    --
    Message posted via AccessMonster.c om


    Comment

    • bhicks11 via AccessMonster.com

      #3
      Re: incremental ID resetting each month

      Sorry - use day(now())

      bhicks11 wrote:
      >The day() function gives you the day of the month. Use it to get your number.
      >
      >Bonnie
      >http://www.dataplus-svc.com
      >
      >>i am trying to get "ID" an incremental number that simply resets to 1 each
      >>month in my "table1" thanks,
      --
      Message posted via AccessMonster.c om


      Comment

      • drrajnishpatel via AccessMonster.com

        #4
        Re: incremental ID resetting each month

        thanks for your response,...... but i think i am misunderstood.. ..the
        incremental number takes entry daily.... goes from 1 to 99 over the month and
        again resets to 1 on the 1st of next month.....thank s

        bhicks11 wrote:
        >Sorry - use day(now())
        >
        >>The day() function gives you the day of the month. Use it to get your number.
        >>
        --
        Message posted via AccessMonster.c om


        Comment

        • paii, Ron

          #5
          Re: incremental ID resetting each month

          Assuming you have a date field in your table. The following will give you
          the next value for your counter.

          nz(dmax("[CounterFieldNam e]","TableNam e","[DateField]>=dateserial(ye ar(now),
          month(now),1)") ,0)+1

          "drrajnishp atel via AccessMonster.c om" <u37542@uwewrot e in message
          news:88b5dbea96 bd2@uwe...
          thanks for your response,...... but i think i am misunderstood.. ..the
          incremental number takes entry daily.... goes from 1 to 99 over the month
          and
          again resets to 1 on the 1st of next month.....thank s
          >
          bhicks11 wrote:
          Sorry - use day(now())
          >The day() function gives you the day of the month. Use it to get your
          number.

          Comment

          • drrajnishpatel via AccessMonster.com

            #6
            Re: incremental ID resetting each month

            Thanks Ron.... i will run the code and come back to you.....yes i have a date
            field....

            paii, Ron wrote:
            >Assuming you have a date field in your table. The following will give you
            >the next value for your counter.
            >
            >nz(dmax("[CounterFieldNam e]","TableNam e","[DateField]>=dateserial(ye ar(now),
            >month(now),1)" ),0)+1
            >
            >thanks for your response,...... but i think i am misunderstood.. ..the
            >incremental number takes entry daily.... goes from 1 to 99 over the month and
            >[quoted text clipped - 3 lines]
            >
            >>The day() function gives you the day of the month. Use it to get your number.
            --
            Message posted via AccessMonster.c om


            Comment

            • drrajnishpatel via AccessMonster.com

              #7
              Re: incremental ID resetting each month

              HATS OFF to you.... you helped me to solve a very very long problem....i am a
              surgeon....a professor of surgery but a child in Access... but i have
              deVeloped a passion for access....i am creating a database for my own clinic..
              and i wanted to creat a incremental unique id for each patient....so that
              the unque id would look like 20080910, for the tenth patient in the august
              month of the 2008 yeaR.... but copuld not do it...like all the veterans
              advised could not put it togather, but your help put the final nail into the
              problem and it has just clicked excellent.....T HANKS RON...

              paii, Ron wrote:
              >Assuming you have a date field in your table. The following will give you
              >the next value for your counter.
              >
              >nz(dmax("[CounterFieldNam e]","TableNam e","[DateField]>=dateserial(ye ar(now),
              >month(now),1)" ),0)+1
              >
              >thanks for your response,...... but i think i am misunderstood.. ..the
              >incremental number takes entry daily.... goes from 1 to 99 over the month and
              >[quoted text clipped - 3 lines]
              >
              >>The day() function gives you the day of the month. Use it to get your number.
              --
              Message posted via AccessMonster.c om


              Comment

              • bhicks11 via AccessMonster.com

                #8
                Re: incremental ID resetting each month

                Congratulations ! Nice little piece of code Ron.

                Bonnie
                Data entry services, data entry and database programming services since 1992. Security, accuracy, and reasonable pricing. (678) 773-6504


                drrajnishpatel wrote:
                >HATS OFF to you.... you helped me to solve a very very long problem....i am a
                >surgeon....a professor of surgery but a child in Access... but i have
                >deVeloped a passion for access....i am creating a database for my own clinic..
                >.and i wanted to creat a incremental unique id for each patient....so that
                >the unque id would look like 20080910, for the tenth patient in the august
                >month of the 2008 yeaR.... but copuld not do it...like all the veterans
                >advised could not put it togather, but your help put the final nail into the
                >problem and it has just clicked excellent.....T HANKS RON...
                >
                >>Assuming you have a date field in your table. The following will give you
                >>the next value for your counter.
                >[quoted text clipped - 7 lines]
                >>
                >>>The day() function gives you the day of the month. Use it to get your number.
                --
                Message posted via AccessMonster.c om


                Comment

                • drrajnishpatel via AccessMonster.com

                  #9
                  Re: incremental ID resetting each month

                  dear ron.... a little trouble the series does go beyond '10' any reason here

                  drrajnishpatel wrote:
                  >HATS OFF to you.... you helped me to solve a very very long problem....i am a
                  >surgeon....a professor of surgery but a child in Access... but i have
                  >deVeloped a passion for access....i am creating a database for my own clinic..
                  >.and i wanted to creat a incremental unique id for each patient....so that
                  >the unque id would look like 20080910, for the tenth patient in the august
                  >month of the 2008 yeaR.... but copuld not do it...like all the veterans
                  >advised could not put it togather, but your help put the final nail into the
                  >problem and it has just clicked excellent.....T HANKS RON...
                  >
                  >>Assuming you have a date field in your table. The following will give you
                  >>the next value for your counter.
                  >[quoted text clipped - 7 lines]
                  >>
                  >>>The day() function gives you the day of the month. Use it to get your number.
                  --
                  Message posted via AccessMonster.c om


                  Comment

                  • paii, Ron

                    #10
                    Re: incremental ID resetting each month

                    Are you having a problem or is it just a concern?
                    The "dMax" function returns the largest value in the selection set; in this
                    case all records in the current month. The code will continue counting up
                    until the month changes.

                    "drrajnishp atel via AccessMonster.c om" <u37542@uwewrot e in message
                    news:88b84ba4a2 4cf@uwe...
                    dear ron.... a little trouble the series does go beyond '10' any reason
                    here
                    >
                    drrajnishpatel wrote:
                    HATS OFF to you.... you helped me to solve a very very long problem....i
                    am a
                    surgeon....a professor of surgery but a child in Access... but i have
                    deVeloped a passion for access....i am creating a database for my own
                    clinic..
                    .and i wanted to creat a incremental unique id for each patient....so
                    that
                    the unque id would look like 20080910, for the tenth patient in the
                    august
                    month of the 2008 yeaR.... but copuld not do it...like all the veterans
                    advised could not put it togather, but your help put the final nail into
                    the
                    problem and it has just clicked excellent.....T HANKS RON...
                    >Assuming you have a date field in your table. The following will give
                    you
                    >the next value for your counter.
                    [quoted text clipped - 7 lines]
                    >
                    >>The day() function gives you the day of the month. Use it to get
                    your number.

                    Comment

                    • drrajnishpatel via AccessMonster.com

                      #11
                      Re: incremental ID resetting each month

                      once again .....THANKS RON ... for your concern ... i had that problem... on
                      my form but then i found there was some clash of code... i was mixing up to
                      different codes on one event and pulling results to different columns.... i
                      could identify that and so sepratyed the events into before and after update..
                      .. your little piece of code is marvellous..... thanks for doing follow up
                      also.....
                      drrajnishpatel

                      paii, Ron wrote:
                      >Are you having a problem or is it just a concern?
                      >The "dMax" function returns the largest value in the selection set; in this
                      >case all records in the current month. The code will continue counting up
                      >until the month changes.
                      >
                      >dear ron.... a little trouble the series does go beyond '10' any reason here
                      >>
                      >[quoted text clipped - 12 lines]
                      >>
                      >>>The day() function gives you the day of the month. Use it to get your number.
                      --
                      Message posted via AccessMonster.c om


                      Comment

                      Working...