DATE RANGE PLS HELP

Discussion in 'Tally Developer' started by Saurabh, Jan 28, 2019.

    
  1. Saurabh

    Saurabh Member


    HOW TO USE DATE FIELS AND DEFINE FROM DATE AND COMPUTE TO DATE AUTO..
    AS PER ATTACHED IMAGE PLS HELP

    KINDLY CORRECT MY CODE AS BELOW....

    [Line : ks amc date]

    Space Top : 2.5
    Field : short prompt, ks date from ,simple prompt, ks date to
    Local : Field : short prompt : Set as : "Date From:"
    Local : Field : simple prompt : Info : $$LocaleString:"Date TO:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ks date from]

    Use : uni date field
    Set as :$$DateFrom ;$$DateRange:##SVCurrentDate:"02-06-2009":True; $$Datefrom
    Storage : ksamcdatefrom
    Width : 12
    Format : Short Date, Separator:"/"

    [Field : ks date to]

    Use : uni date field
    Set as :$$DateTo;$$DateRange:"365 Days":$$Datefrom:True
    Storage : ksamcdateto
    Width : 12
    Format : Short Date, Separator:"/"
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    $$DateRange:"365 Days":#ksdatefrom:True

    But, what if it is a leap year???

    You can refer to my post on date/time difference calculator.... will give you ideas on how to tackle this issue.
     
    Saurabh likes this.


  3. Saurabh

    Saurabh Member



    thanks for your reply but NOT working i tried this

    and also i not found post on date/time difference calculator PLS share me link
     


  4. Saurabh

    Saurabh Member





    You can refer to my post on date/time difference calculator.... will give you ideas on how to tackle this issue.

    not found sir
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [System : Formula]
    DaysinYear : IF ##SVToDate - ##SVFromDate + 1 = 366 Then 366 Else 365

    [Field : ks date to]
    Use : uni date field
    Set as : $$Date:#ksdatefrom + @@DaysinYear
    Storage : ksamcdateto
    Width : 12
    Format : Short Date, Separator:"/"
     
    Saurabh likes this.


  6. Saurabh

    Saurabh Member



    Please help as per my following code...PLS Help to correct Thanks (Image attached)
     

    Attached Files:



  7. Saurabh

    Saurabh Member


    [Line : ks amc date]

    Space Top : 2.5
    Field : short prompt, ks date from ,simple prompt, ks date to
    Local : Field : short prompt : Set as : "Date From:"
    Local : Field : simple prompt : Info : $$LocaleString:"Date TO:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ks date from]

    Use : uni date field
    Set as :$$DateRange:"365 Days":#ksdatefrom:True
    ;$$DateFrom:##Svcurrentdate ;$$DateRange:##SVCurrentDate:"02-06-2009":True; $$Datefrom
    Storage : ksamcdatefrom
    Width : 12
    Format : Short Date, Separator:"/"


    [Field : ks date to]
    Use : uni date field
    Set as : $$Date:#ksdatefrom + @@DaysinYear
    Storage : ksamcdateto
    Width : 12
    Format : Short Date, Separator:"/"

    [System : Formula]
    DaysinYear : IF ##SVToDate - ##SVFromDate + 1 = 366 Then 366 Else 365
    /*
    $$DateRange:"10 Days":$Date:True

    The resultant Due Date will be 10 days from $Date including $Date.
    */

    [System : UDF]

    amcvisit : Number : 2019
    ksamcselect : String : 2020
    ksamcdatefrom : Date : 2021
    ksamcdateto : Date : 2022
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    show me your ....REPORT code please.....

    if you can't share here then please email it on nehalsofttech@gmail.com
     


  9. Saurabh

    Saurabh Member



  10. young man

    young man New Member


    Dear Amit Sir,

    Please solve my following tdl issue.

    I have done sales MIS Report. It is working done. I have to need export in Excel sheet for particular sales bill details only. It is showing error. I don't know what mistake done in my report. Please help me your valuable suggestion.

    ** I want expert to excel file selected bills in this report only. Not Required Solution for default Tally report.
     

    Attached Files:



  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Got your file....gone through the same....... not working ... because of missing components.

    You need to define SVFromDate and SVToDate in your report level.
     


  12. young man

    young man New Member


    Ok.Sir, Thanks for your quick reply. I will check and any problem i will send revised code.
     


  13. Saurabh

    Saurabh Member


    Hello my problem is Different PLEASE TRY TO UNDERSTAND....

    if i give from date then TO DAte autocatic calculate 1 year From "From DATE field"
     


  14. Saurabh

    Saurabh Member


    I WANT TO SET LIKE THIS ...SEE THE ATTACHED FILE...
     

    Attached Files:



  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Dear Young Man,

    the reply was not for you......... This thread is for "Date Range" query and it was meant for that.

    As for you, if you want replies and better visibility by other experts, then make a separate thread for your own query.

    As I said earlier, many times, I will not respond to hijacked threads, PMs or Inbox messages. If everyone does that then other members will NOT learn from Q-A of other peoples' topics. Nor will anyone know, if within one topical thread lies another query.
     
    Last edited: Jan 30, 2019


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You will need to set/define multiple formulas based on the periodicity i.e. monthly, halfyearly etc.....

    e.g. If monthly and month = 4 or 6 or 9 or 11 then 30
    If monthly and month =2 and SVToDate - SVFromDate +1 = 366 then 29 else 28
    If monthly and "all other months" then 31......and so on
     


  17. Saurabh

    Saurabh Member




    YA I DEFINED BUT ITS NOT AFFECTING
     


  18. Saurabh

    Saurabh Member


    ;; this code use to enable amc for ledger in master

    [#Part: MST LED explode Sundry]

    Add: Line: after : led affectsstock : My amc line

    [Line: My amc line]

    Field: Medium prompt,insamcLED
    Local: Field: Medium prompt :info : $$LocaleString:"Amc Taken ?"

    [Field : insamcLED]

    Use : Use: logical field
    Show Table : Always
    Set as : Yes
    Set Always : Yes
    Sub Form: insamcsubform : $$value = Yes

    [Report : insamcsubform]

    Form : insamcsubform
    Variable : SVFromDate:Date
    Variable : SVToDate:Date

    SET : SVFromDate : $$CurrentPeriodFrom:##SVCurrentDate
    SET : SVToDate : $$CurrentPeriodTo:##SVCurrentDate

    [Form : insamcsubform]

    Part : insamcsubform
    Height : 30% page
    Width : 40% page

    [Part : insamcsubform]

    Line : insamcsubform
    Add : Line : After : insamcsubform : INSAMCPERIODline
    Add : Line : After : INSAMCPERIODline : ks amc date

    [Line : insamcsubform]

    Field : INSAMCSUBFORM

    [Field : insamcsubform]

    Use : name field
    Set as : "AMC DETAILS"
    Unique : Yes
    Border : Thin Bottom
    Style : Header Title3
    Space Left : 20
    Width : 15
    Skip : Yes

    [Line : INSAMCPERIODline]

    Field : short prompt , ksamcperiod , simple prompt , ksamcvisit
    Local : Field : short prompt : Set as :"AMC Period:"
    Local : Field : simple prompt : Info : $$LocaleString:"No_Of.Visit:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ksamcperiod]

    Use : name field
    Set as : $$Value
    Storage: ksamcselect
    Table : ksamcofr
    Show Table : Always
    Width : 11


    [Field : ksamcvisit]

    Use : number field
    Set as :""
    Storage :amcvisit
    Format : NOCOMA , NO ZERO

    [Line : ks amc date]

    Space Top : 2.5
    Field : short prompt, ks date from ,simple prompt, ks date to
    Local : Field : short prompt : Set as : "Date From:"
    Local : Field : simple prompt : Info : $$LocaleString:"Date TO:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ks date from]

    Use : uni date field
    Set as :$$DateFrom:##SVCurrentdate:"365 Days":True
    ;$$DateFrom:##Svcurrentdate ;$$DateRange:##SVCurrentDate:"02-06-2009":True; $$Datefrom
    Storage : ksamcdatefrom
    Width : 12
    Format : Short Date, Separator:"/"

    [Field : ks date to]

    Use : uni date field
    Set as : $$date:##SVFROMDATE + @@DaysinYear
    Storage : ksamcdateto
    Width : 12
    Format : Short Date, Separator:"/"

    [System : UDF]

    amcvisit : Number : 2019
    ksamcselect : String : 2020
    ksamcdatefrom : Date : 2021
    ksamcdateto : Date : 2022

    [System : Formula]
    DaysinYear : IF ##SVToDate - ##SVFromDate + 1 = 366 Then 366 Else 365

    /*
    $$DateRange:"10 Days":$Date:True

    The resultant Due Date will be 10 days from $Date including $Date.
    */



    NOW TO DATE COMING AUTOMATIC........BUT NOT TAKING AS PER FROM DATE...
     

    Attached Files:



  19. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You are suppose to use this...as explained to you earlier.........

    Set as : $$Date:#ksdatefrom + @@DaysinYear
     


  20. Saurabh

    Saurabh Member


    :(NOT RESOLVED TRIED EVERYTHING......:oops::oops:
     


  21. Saurabh

    Saurabh Member



    SIR PLEASE HELP....
     


  22. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    I've already replied......and gave you a solution..... don't have any more answer........
     


  23. Murali.R

    Murali.R Member



    SaurabhMember

    ;; this code use to enable amc for ledger in master

    [#Part: MST LED explode Sundry]

    Add: Line: after : led affectsstock : My amc line

    [Line: My amc line]

    Field: Medium prompt,insamcLED
    Local: Field: Medium prompt :info : $$LocaleString:"Amc Taken ?"

    [Field : insamcLED]

    Use : Use: logical field
    Show Table : Always
    Set as : Yes
    Set Always : Yes
    Sub Form: insamcsubform : $$value = Yes

    [Report : insamcsubform]

    Form : insamcsubform
    Variable : SVFromDate:Date
    Variable : SVToDate:Date

    SET : SVFromDate : $$CurrentPeriodFrom:##SVCurrentDate
    SET : SVToDate : $$CurrentPeriodTo:##SVCurrentDate

    [Form : insamcsubform]

    Part : insamcsubform
    Height : 30% page
    Width : 40% page

    [Part : insamcsubform]

    Line : insamcsubform
    Add : Line : After : insamcsubform : INSAMCPERIODline
    Add : Line : After : INSAMCPERIODline : ks amc date

    [Line : insamcsubform]

    Field : INSAMCSUBFORM

    [Field : insamcsubform]

    Use : name field
    Set as : "AMC DETAILS"
    Unique : Yes
    Border : Thin Bottom
    Style : Header Title3
    Space Left : 20
    Width : 15
    Skip : Yes

    [Line : INSAMCPERIODline]

    Field : short prompt , ksamcperiod , simple prompt , ksamcvisit
    Local : Field : short prompt : Set as :"AMC Period:"
    Local : Field : simple prompt : Info : $$LocaleString:"No_Of.Visit:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ksamcperiod]

    Use : name field
    Set as : $$Value
    Storage: ksamcselect
    Table : ksamcofr
    Show Table : Always
    Width : 11


    [Field : ksamcvisit]

    Use : number field
    Set as :""
    Storage :amcvisit
    Format : NOCOMA , NO ZERO

    [Line : ks amc date]

    Space Top : 2.5
    Field : short prompt, ks date from ,simple prompt, ks date to
    Local : Field : short prompt : Set as : "Date From:"
    Local : Field : simple prompt : Info : $$LocaleString:"Date TO:"
    Local : Field : simple prompt : Space Left : 15

    [Field : ks date from]

    Use : uni date field
    Set as :$$DateFrom:##SVCurrentdate:"365 Days":True
    ;$$DateFrom:##Svcurrentdate ;$$DateRange:##SVCurrentDate:"02-06-2009":True; $$Datefrom
    Storage : ksamcdatefrom
    Width : 12
    Format : Short Date, Separator:"/"

    [Field : ks date to]

    Use : uni date field
    Set as : $ksamcdatefrom + @@DaysinYear
    Storage : ksamcdateto
    Width : 12
    Format : Short Date, Separator:"/"

    [System : UDF]

    amcvisit : Number : 2019
    ksamcselect : String : 2020
    ksamcdatefrom : Date : 2021
    ksamcdateto : Date : 2022

    [System : Formula]
    DaysinYear : IF #Mridatefrom - #Mridatefrom + 1 = 366 Then 366 Else 365

    /*
    $$DateRange:"10 Days":$Date:True

    The resultant Due Date will be 10 days from $Date including $Date.
    */
     


  24. Murali.R

    Murali.R Member


     
    Saurabh likes this.


  25. Saurabh

    Saurabh Member



    ya sir i know and really very much thankful for all ,

    but sir atleast guide me where i m doing wrong.....so i can study on it and try to resolve ....

    point is i m not understanding where i m doing wrong......

    command given by u where to put .....
     


Share This Page