Choose Language Hide Translation Bar
Highlighted
Kevin
Level I

select day and input text

Hello,

 

I tried to  write "test" on Status column when date is 26. so I first get day from time column and write the follow script, but it doesn't work. Can someone take a look what's wrong with my script

TimedateStatus
06/26/2018 1:46:50 PM26 
06/27/2018 2:30:09 PM27 
06/28/2018 4:13:20 PM28 

 

sdt=current data table();

sdt << selectwhere (:date ==day(26) );
selRows = sdt << getselectedRows;
Ascolumn (sdt, "Status")[selRows]="test";

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: select day and input text

You are taking the Day() function of 26, and what you want to do is to take the Day() function of the :Date column.

sdt = Current Data Table();

sdt << selectwhere( Day( :date ) == 26 );
selRows = sdt << getselectedRows;
As Column( sdt, "Status" )[selRows] = "test";
Jim

View solution in original post

3 REPLIES 3
Highlighted
txnelson
Super User

Re: select day and input text

You are taking the Day() function of 26, and what you want to do is to take the Day() function of the :Date column.

sdt = Current Data Table();

sdt << selectwhere( Day( :date ) == 26 );
selRows = sdt << getselectedRows;
As Column( sdt, "Status" )[selRows] = "test";
Jim

View solution in original post

Highlighted
Kevin
Level I

Re: select day and input text

Thank you, it works! Another question, if I would like to set 26 as vaiable, 

x1=26
sdt << selectwhere (Day(:date) == x1 );
selRows = sdt << getselectedRows;
As column (sdt, "Status")[selRows]="tested";

 

Does this look right?

 

 

txnelson
Super User

Re: select day and input text

What you show will work....with one slight change.....you need a ";" after X1 = 26

X1 = 26;
Jim
Article Labels

    There are no labels assigned to this post.