Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Autoincrement "ticket reference code"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Autoincrement "ticket reference code"

    Here's a puzzle that has me stumped... (I have Alpha5 v9, Platinum, Desktop & Web Applications)

    I am trying to build a Help Desk Ticket database that has a "unique reference number" which is automatically assigned to each record as the record is created. I understand how to put in an 'auto-increment' value in the field BUT I would like it to increment based on the date.

    For example: If a record is being input today (19 Feb 2009) I would like it to look something like 20090219 (yyyymmdd) with an automatically generated "end" value of 001. In other words, the first record created for today would look like "20090219001." Then the second record created today would look like 20090219002. The third record 20090219003 and so on. And THEN as of 12:01am, on 20 Feb 2009, the first record created would look like 20090220001. The second record created (for the 20th) would look like 20090220002, and so on.

    Right now I have this field set up as numeric; with a field length of 15 characters. Would it be a better idea to make it a character field?

    I also have the idea of using a decimal place of 3 at the end of the field. So using the same example as above, the records would look like 20090219.001, 20090219.002 and 20090219.003.

    Can anyone help me with this issue? It would be much appreciated. Thanx.

    #2
    Re: Autoincrement "ticket reference code"

    Would it be a better idea to make it a character field?
    If you don't intend to use the field in a computation it is better character.

    I'll take a look at something to increment your field and get back.
    There can be only one.

    Comment


      #3
      Re: Autoincrement "ticket reference code"

      To Stan...

      Cool. Thanx.

      Comment


        #4
        Re: Autoincrement "ticket reference code"

        Try this, unzip the table and add it to your database, assuming you don't already have a table named test.
        There can be only one.

        Comment


          #5
          Re: Autoincrement "ticket reference code"

          Jesse, I'd be willing to wager that at some point down the road you'll wish you had gone with a straight auto-increment value (for internal use only) to uniquely identify each ticket. And then for each ticket, another field named date_created or something similar.

          Just a thought from someone who's been there, done that...

          ba

          Comment


            #6
            Re: Autoincrement "ticket reference code"

            To Stan...

            Thank you. Where should I place the file(s) you sent me? Do I open them up in my database?

            Jesse.

            Comment


              #7
              Re: Autoincrement "ticket reference code"

              If you don't already have a table named test, unzip them to your normal database directory and add the table to your database.
              There can be only one.

              Comment


                #8
                Re: Autoincrement "ticket reference code"

                Stan...

                Am sorry but I don't understand where you're talking about. I unzipped the files in "PROGRAM FILES/a5v9". Now how do I get them into my Help Desk Ticket database?

                Jesse.

                Comment


                  #9
                  Re: Autoincrement "ticket reference code"

                  Originally posted by GuyAtLarge View Post
                  how do I get them into my Help Desk Ticket database?
                  Adding tables/sets to a database.
                  There can be only one.

                  Comment


                    #10
                    Re: Autoincrement "ticket reference code"

                    Stan...

                    I tried running the script you sent me last week and it works as far as putting a date stamp on the reference ID and it auto-increments the last 3 characters but... It doesn't change the date portion when the system calendar moves forward.

                    I'd like the date portion (yyyymmdd or 20090302) to reflect the new date when the actual date changes (from 20090302, to 20090303, then 20090304 and so on).

                    I guess what I'm saying 2 separate portions of the string need to increment. The date part has to reflect the new day (so it increments once every 24 hours) and the last 3 characters have to reflect a new record within the specific day.

                    Example; 20090302.001, 20090302.002, 20090302.003, and so on (for March 2nd). Then on March 3rd; 20090303.001, 20090303.002, 20090303.003, and so on. Then on March 4th; 20090304.001, 20090304.002, 20090304.003, and so on.

                    Thanks, so far, for helping me at least narrow it down. We're getting warmer. Lol.

                    Jesse.

                    Comment


                      #11
                      Re: Autoincrement "ticket reference code"

                      Not sure what you mean. I didn't send a script as I remember. I made the id field calculated with the expression.

                      Code:
                      CDATE(DATE())+"."+PADL(ALLTRIM(STR(TABLECOUNT("test","left(id,8)="+QUOTE(CDATE(DATE())))+1)),3,"0")
                      The first portion doesn't "increment" the date portion, CDATE(DATE()), it just takes the system date and converts it. It has to roll over when the date changes.

                      Attached is a screen shot of the calculated value when I started a new record a bit ago.
                      There can be only one.

                      Comment


                        #12
                        Re: Autoincrement "ticket reference code"

                        Stan...

                        Am sorry. I know you didn't send me a script. I meant the functionality of what you sent me. How/where do use what you sent me. What I did is, I COPY-ed; CDATE(DATE())+"."+PADL(ALLTRIM(STR(TABLECOUNT("test","left(id,8)="+QUOTE(CDATE(DATE())))+1)),3,"0") and then PASTED it into FIELD RULES/DATA ENTRY/DEFAULT VALUE Expression Builder.

                        Did I do this right? (The date portion, of the field, didn't change when I created a new record for today.)

                        Jesse

                        Comment


                          #13
                          Re: Autoincrement "ticket reference code"

                          Seems like that should work but I just made the field calculated since there should be no reason to change it.

                          Works for me as a default as well.
                          Last edited by Stan Mathews; 03-02-2009, 03:03 PM.
                          There can be only one.

                          Comment

                          Working...
                          X