If chekbox =1 then set curent date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adrianalin
    Member
    • Sep 2017
    • 48

    If chekbox =1 then set curent date

    Hello i'm traing to set the curent datetime in a atribut when a checkbox is click.

    ifThenElse(var1=='1', var2=datetime\today());

    var1 is a boolean atribute.
    and var2 is a Data atribut theat is initial none and read only

    when i go in to the edit mod and clik on the checkbox and save in view mod i dont see the curent date it's still none

    Pls help
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    Did you try ifThenElse(var1, var2=datetime\today());

    Comment

    • adrianalin
      Member
      • Sep 2017
      • 48

      #3
      Tex so so muci, theat don the job i was looking for !

      Can i asc for one mor problem i'm having?

      My boss whats to see how muci time it taks from dateA to dateB and to show theat in the table

      So i thinc i need to mache a new varchare readonly null and se a formula like
      ifThenElse(dateA!=0&&dateB!=0, var1=dateB-dateA);
      or somfing like this

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        ifThenElse(dateA && dateB, datetime\diff(dateA, dateB, INTERVAL_TYPE)

        Comment

        • adrianalin
          Member
          • Sep 2017
          • 48

          #5
          ifThenElse(createdAt && dataLivrarii, timp=datetime\diff(dataLivrarii, createdAt, minutes));

          timp is Tip: DataTimp
          i put minutes so i can test it but i will use days

          createdAt && dataLivrarii are Tip: DataTimp

          it dosent worck i thing i need a difrent declaration for the timp atribut.....


          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            'minutes' in quotes
            it returns integer value

            Comment

            • adrianalin
              Member
              • Sep 2017
              • 48

              #7
              I dont undestend whai when i tick the box the time says today but in the fiucer from 1:30 pm the curent time to the 3.00 pm alweis
              And the difrence betwin the 2 date it dosen sem to show up aniting seens it's in the fucer

              Comment

              • tanya
                Senior Member
                • Jun 2014
                • 4308

                #8
                datetime\today() returns date (time set as 00, but you have timezone +3, so you see 03:00)
                if you need dateTime - use datetime\now()

                Comment

                • adrianalin
                  Member
                  • Sep 2017
                  • 48

                  #9
                  Thet fix it
                  Silli my didant see datetime\today()

                  but still the other formula
                  ifThenElse(createdAt && dataLivrarii, timp=datetime\diff(dataLivrarii, createdAt, 'minutes'));
                  timp it still donsent return aniting

                  Comment

                  • tanya
                    Senior Member
                    • Jun 2014
                    • 4308

                    #10
                    Did you try this?
                    ifThenElse(livrata, timp=datetime\diff(dataLivrarii, createdAt, 'minutes'));

                    Comment

                    • adrianalin
                      Member
                      • Sep 2017
                      • 48

                      #11
                      Text problem solvd !

                      Comment

                      Working...