November 30, 200520 yr Hi, I have a bunch of records that each have a target date field. Is there a way that I can dynamically find the records that have a target date in the next 7 days? I can't hardcode any dates in there. I know I can find target dates after today by finding records where the date > //, but I can't seem to omit < // + 7 or do any date manipulation with dates in the find criteria. Thanks. -Chris
November 30, 200520 yr Hi you have to make 2 requests ! You can do it in find mode, with the first request being >// and the second being >12/06/2005 (omitt). For repetitive tasks it will be better to make a script !
November 30, 200520 yr Author Right, I see how that works, but I can't enter 12/6/2005 because this script will run everyday so I can't hardcode the date for the omit cutoff. Is there another way to make this work?
November 30, 200520 yr Try: Enter Find Mode [] Set Field [ yourTable::yourDatefield ; Get (CurrentDate) & ".." & Get (CurrentDate) + 7 ] Perform Find []
December 2, 200520 yr I am still learning scripts. I went in and wrote this script that you gave for an example and I keep getting errors. This is what I am getting. An operator (e.g.+,-,*,...) is expected here. It highlights everything from Get(CurrentDate) to the end of it. I am in scriptmaker and I double click SetField then I go to calculation and type everything in that you gave the example for. What am I doing wrong? Thank you.
December 2, 200520 yr You are probably pasting in the brackets "[" "]", you only need to paste this: Get (CurrentDate) & ".." & Get (CurrentDate) + 7 In the calculation box. HTH Lee
December 2, 200520 yr I think it's a pretty common error at first ... Everything inside the Set Field is being placed in the calc box, even according to his description of what he is doing "I double click SetField then I go to calculation", as: yourTable::yourDatefield ; Get (CurrentDate) & ".." & Get (CurrentDate) + 7 You need to FIRST select Specify Field and enter your field name as indicated by everything before the first semi-colon. Only the last portion AFTER the semi-colon should be put in the calc box as Lee indicated, or: Get (CurrentDate) & ".." & Get (CurrentDate) + 7
December 2, 200520 yr Thank you. That worked when I just put in the Get (CurrentDate) so forth. I was going by the first script that showed to put in the table and the field so I put the folloing. Set Field[] Then I clicked on calculation and put this in: Rifles::Date Sold;Get(CurrentDate)&".."& Get(CurrentDate)+ 7 That is when the error popped up. It looks like it works without the Rifles::Date Sold. But what would happen if I needed it in there? Is there another way to do it?
December 3, 200520 yr "it works without the Rifles::Date Sold. But what would happen if I needed it in there? " As I explained above there are TWO parts to a Set Field[] script step: [color:red]1) The field to set (button says Specify Target Field) [color:blue]2) Set with what (button says Calculated Result) Set Field [ [color:red]yourTable::yourDatefield ; [color:blue]Get (CurrentDate) & ".." & Get (CurrentDate) + 7 ] LaRetta :wink2:
Create an account or sign in to comment