May 26, 201510 yr I need to find records that meet a certain request when using a script. I've got 2 fields that I need to find across. Status and Timestamp. (Timestamp is a timestamp field) I need to find all records that Status = "Approved" Also need it to return all records that Status = "Complete" and have a timestamp range from 3am until Current time. I'm not seeing how I do multiple find request using a script. Thanks for your help.
May 26, 201510 yr I'm not seeing how I do multiple find request using a script. The way to do that is to use the New Record/Request step: Enter Find ModeSet Field [ Table::status ; "Approved" ]New Record/RequestSet Field [ Table::status ; "Complete" ]Set Field [ Table::timeStampField ; ">" & Time ( 3 ; 0 ; 0 ) ]Set Error Capture [ on ]Perform Find
May 26, 201510 yr This part is not clear: have a timestamp range from 3am until Current time. From 3am when? Today? What if the current time is less than 3am? I'm not seeing how I do multiple find request using a script. One way is to enter find mode, fill out the first request, then call New Record/Request to create another request.
May 26, 201510 yr Author The way to do that is to use the New Record/Request step: Enter Find ModeSet Field [ Table::status ; "Approved" ]New Record/RequestSet Field [ Table::status ; "Complete" ]Set Field [ Table::timeStampField ; ">" & Time ( 3 ; 0 ; 0 ) ]Set Error Capture [ on ]Perform Find This worked Perfect..Never Knew the New Record/Request was for that. Thanks
May 26, 201510 yr Author This part is not clear: From 3am when? Today? What if the current time is less than 3am? Your right...Never thought of this part. Ot looks like I will need to do an If script that looks a the current time. If current time is after 3 am then it will need to find based on today date after 3am. If Current time is between 12am and 2:59am then it needs to find today date between 12am and 2:59 and Yesterday date till 3am. I guess the part I would need help on is the 2nd If Statement. How do you do a between date?
May 26, 201510 yr If you want to know more about performing finds, start by reading the help. Making a find request
May 26, 201510 yr If Current time is between 12am and 2:59am then it needs to find today date between 12am and 2:59 and Yesterday date till 3am. I am afraid that's not quite clear either.
May 27, 201510 yr Author The Issue is that Days end does not end at 12pm. Their day ends at 3am. So when they run this report after 12pm and before 3am They need to only show stuff that was done from the previous day after 3am plus anything that was done between 12am-3am the same day. I think I've got something that is working, will need to test. I set a Set a Variable $$TIME_OFFSET If ( Get ( CurrentTime ) > "12:00:00 AM"; If ( Get ( CurrentTime ) < "03:00:00 AM" ; "TRUE" ; "FALSE" ) ; "FALSE" ) Then I did an IF based script on the TRUE/FALSE Variable to know what FIND script to run based on the current time. Edited May 27, 201510 yr by Devin
May 27, 201510 yr Do they have any future records? If not, you can find the relevant records - i.e. records that occurred after the most recent 3:00 AM - by: Enter Find Mode [] ... Set Field [ YourTable::YourField ; "≥" & Timestamp ( Get(CurrentDate) - ( Get(CurrentTime) < 10800 ) ; 10800 ) ] ... Perform Find Note: 10800 is shorthand for Time ( 3 ; 0 ; 0 ).
Create an account or sign in to comment