May 24, 200421 yr Hi there, I do my cashouts from 4pm to 4pm opposed to daily. I developed a script that searches in part the sales. Fields: Date (Date): Creation Date Time (Time): Creation Time Yesterday Today(Calculation - text): DateToText(Today- 1) & "..." & DateToText(Today) Four Oclock (Time - Auto Enter data): 16:00:00 Four Oclock Minus one Second (Time - Auto Enter Data): 15:59:59 Four Oclock String (Calculation - text): TimeToText(Four OClock) & "..." & TimeToText(Four OClock Minus One Second) The Script: Copy (Select "Yesterday Today") Enter Find Mode() Paste (Select "Date") Go To Field (Time) Pause/Resume Script() Insert Text (Select "Time") Perform Find (Replace Found Set) --- I know there is something wrong but I can't pin point the problem. I want to use the Four Oclock String field but I don't how to make it work with the search script! Any help is welcome, bk17
May 24, 200421 yr Hi bk17, I would recommend a couple of changes in your calculations and script: It is better to use the function Status(CurrenDate) instead of Today. You will find that you'll have better control over results by using Insert Calculated results instead of paste. Date and Times can be tricky, so if the changes don't do it, be sure and check that the calculations are Date and Time (fields or Results are in Date and Time), or you may need to convert them by using Text to Date and Text to Time in your calculations. HTH Lee
May 24, 200421 yr Author I modified Today to Status(CurrentDate) and replace Paste by Insert Text but no result. I modified the script. It looks like this now: Copy (Select "Yesterday Today") Enter Find Mode() Insert Text (Select "Date") Copy (Select "Four Oclock String" Insert Text (Select "Time") Perform Find (Replace Found Set) --- Any help- bk17
May 24, 200421 yr I would split this into two requests, one for yesterday after 3:59, and one for today before 4 PM. Enter Find Mode [ ] Set Field [Date, Status(CurrentDate) - 1] Insert Text [select, Time, ">=16:00:00"] New Record/Request Set Field [Date, Status(CurrentDate)] Insert Text [select, Time, "<16:00:00"] Perform Find[ ] I haven't tested this too much. So let me know how it works out.
May 24, 200421 yr Try Insert Calculated Result instead of Insert Text, and be more specific about how it didn't work. What were the results?
May 24, 200421 yr It doesn't work because Four Oclock string does not exist in Find Mode, so you can't copy it. You're only finding records from yesterday and today. I don't think it will work that way anyway, because 16:00:00...15:59:59 is like saying Status(CurrentDate) & "..." & Status(CurrentDate) - 1. The starting value is greater than the ending one, which is why I split it into two days.
May 24, 200421 yr You are right of course. Duh. I didn't get an error beep, so it appeared to work. Lee
May 25, 200421 yr Author Hi Queue I am a bit puzzle with your comment: Try Insert Calculated Result instead of Insert Text. Do I use that with the four oclock string? Do I enter any information in Specify? In any case, can you build me a script that would work? looking for your reply bk17
May 25, 200421 yr Use the same steps I provided earlier, just substitute Insert Calculated Result for Insert Text. Insert Text worked fine for me, but I haven't done much work with time fields. They seem much more persnickity than date fields. Add Pause/Resume steps after setting the time field to see what data is being entered.
May 25, 200421 yr Author Queue, The Insert Calculated Result doesn't let me enter '>=16:00:00' in Specify. There is a syntax error. bk17
May 25, 200421 yr Author Queue, OKay, I added the quote. I performed the script but it didn't work. I decided to build you a little file. I created 5 records. The script should find 2 out 5. I imported the script and it worked with the little file. I almost step out of my chair. What's wrong with my genuine file? Some clues... Date and Time fields are creation fields. When I perform the script, the view is a form. All fields can be seen on screen. Gosh, any idea!! bk17
May 25, 200421 yr Firstly, the Insert Calculated Result script step requires that the referenced field is on the current layout. If it isn't the insert won't happen. It's caught me before. Secondly, are the date and time fields *really* date and time fields? (Not data type text.)
May 25, 200421 yr Author Hey Vaughan, Thanks for your comments. They sparked a solution. I realized that my Date and Time fields were located in the header. I moved them and it worked perfectly. I use a view form to do my cash out. All fields are displayed to do a nice print out. bk17
Create an account or sign in to comment