Date greater than a specific date

Discussion in 'Tally Developer' started by NSA, Nov 10, 2021.

    
  1. NSA

    NSA Member


    Dear Friends/Experts,

    The below code is an example of setting Control/Checkpoint based on Date greater than a specific date. For Example we need to implement something from tomorrow(2021-11-10) then we can use the below code reference. I am posting it here because I got this idea by referring various posts in this group. Hope, it will be a helpful for the beginners and of course as usual, I expect the remarkable feedback, suggestions and corrections from experts.

    [Field : RCPDiscAutoJournal Passed YNoFldDmmy]
    Use : Number Field;Short Name Field;
    Format:"No Comma,NoZero"
    Align : Left
    Skip : yes
    Color:mad:RCPDiscAutoJournYNoFldStoreValueDerived
    RCPDiscAutoJournYNoFldStoreValueDerived:if $RCPDiscAutoJournYNoFldStore="Yes" Then "Dark Green" Else "Red"
    width : 10
    Set as:($$Number:($$String:mad:@YearofDate+$$ZeroFill:mad:@MonthofDate:2+$$ZeroFill:mad:@DayofDate:2))

    Skip:Yes
    Invisible:if $$InCreateMode then yes else if $RCPAgentVCHCommissionAmt>0 Then No Else Yes

    [Field : RCPDiscAutoJournal Passed YNoFld]
    Use : Short Name Field; Number Field;
    Align : Left
    Skip : yes
    Color:mad:RCPDiscAutoJournYNoFldStoreValueDerived
    RCPDiscAutoJournYNoFldStoreValueDerived:if $RCPDiscAutoJournYNoFldStore="Yes" Then "Dark Green" Else "Red"
    width : 10
    Set as:if #RCPDiscAutoJournalPassedYNoFldDmmy<=20211109 then "Yes" else if $$IsEmpty:$$Value Then "No" Else $RCPDiscAutoJournYNoFldStore

    Storage:RCPDiscAutoJournYNoFldStore
    Skip:Yes
    Invisible:if $$InCreateMode then yes else if $RCPAgentVCHCommissionAmt>0 Then No Else Yes

    [System:Formula]
    RCPDt20211109:(@@RCPDateConvertedNumber/@@RCPDt20211109Num)>1
    RCPDt20211109Num:$$Number:$$String:"20211109"
    RCPDateConvertedNumber::($$Number:($$String:mad:@YearofDate+$$ZeroFill:mad:@MonthofDate:2+$$ZeroFill:mad:@DayofDate:2))
    DayofDate:$$DayOfDate:#PlainVCHDate
    MonthofDate:$$MonthOfDate:$Date
    YearofDate:$$YearOfDate:$Date
     
    Last edited: Nov 10, 2021


Share This Page