Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unhappy Unanswered: Julain Date and Sequential Numbers

    I need some help writing a code that would start off with the current julian date and then have a 3-digit number. ie, 4078-001.

    Then as each new record is added the number would increment by by 1 ie, 4078-002, 4078-003.

    I would like it to not leave any spaces and also it would have to start over at 001 on the next julian date. ie, 4079-001.

    Does anyone have any ideas on how to do this??

    Thank you,

    Frank

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    I would use something like this:

    get the julian date using the format function if needed
    cnt = nz(dmax("right([id],3)","YourTable","[id] like " & jdate & "*"),0)
    id = jdate & "-" & cnt + 1

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    Can't seem to get Dmax to work am I missing something.?

  4. #4
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    You have to replace some of the words with those in your database

    Yourtable = the table name with the data
    id = the name of the field in the table
    jdate = a variable or field name with the desired julian date without the "-001"

    Are you getting an error message or is it just not returning the right value?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •