Getting Started

 View Only
  • 1.  Log Number

    Posted 12-17-2021 10:52

    Hi,

    May someone help me create a formula for a Rich Text (Formula) field  to be able to create a log number based on a Date / Time field.

    Example:

    Date / Time = 12-17-2021 1:33 PM

    I want may Rich Text (Formula) field to to show 2112001

    Where 21 = year,  12 = month, 001 is login number

    Please advise. Thank  you in advance.



    ------------------------------
    Raymond Marlon Tiangco
    ------------------------------


  • 2.  RE: Log Number

    Posted 12-17-2021 12:33
    is [Log in number]  just a field on the record?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Log Number

    Posted 15 days ago
    Yes Login Number is just a filed on the record.

    ------------------------------
    Raymond Marlon Tiangco
    ------------------------------



  • 4.  RE: Log Number

    Posted 14 days ago

    Try this

    var text MyDate = ToDate([My Date / Time field]);
    var text YY = Right(ToText(Year($My Date));
    var text MM = PadLeft(ToText(Month($My Date)),2, "0");

    List("", $YY, $MM, ToText([Login Number]))



    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Log Number

    Posted 12-17-2021 12:48
    Edited by Paul Peterson 12-17-2021 14:52
    You could create two fields to extract the year and month similar to:

    Formula Text fields:
    Year Date:
    ToText(Right(Year([Date Field]), 2))

    Month Date:
    PadLeft(ToText(Month([Date Field])), 2, "0") 

    then in your log field:

    var text formulaQuery = "{FID1.EX.'" & [Year Date] & "'} AND {FID2.EX.'" & [Month Date] & "'} AND {3.LTE.'" & [Record ID#] & "'}";

    [Year Date] & [Month Date] & PadLeft(ToText(Size(GetRecords($formulaquery))), 5, "0")

    where FID1 is the field ID of the year date field and FID2 is the field ID for the month date field

    ------------------------------
    Paul Peterson
    ------------------------------