TheOriginalChris Posted November 30, 2005 Posted November 30, 2005 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
Raybaudi Posted November 30, 2005 Posted November 30, 2005 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 !
TheOriginalChris Posted November 30, 2005 Author Posted November 30, 2005 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?
comment Posted November 30, 2005 Posted November 30, 2005 Try: Enter Find Mode [] Set Field [ yourTable::yourDatefield ; Get (CurrentDate) & ".." & Get (CurrentDate) + 7 ] Perform Find []
TaiChi56 Posted December 2, 2005 Posted December 2, 2005 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.
Lee Smith Posted December 2, 2005 Posted December 2, 2005 You are probably pasting in the brackets "[" "]", you only need to paste this: Get (CurrentDate) & ".." & Get (CurrentDate) + 7 In the calculation box. HTH Lee
LaRetta Posted December 2, 2005 Posted December 2, 2005 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
TaiChi56 Posted December 2, 2005 Posted December 2, 2005 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?
LaRetta Posted December 3, 2005 Posted December 3, 2005 "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:
Recommended Posts
This topic is 6933 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now