working.account Posted March 27, 2007 Posted March 27, 2007 Hello All, I wrote a script using script maker that performs a find, but I need it to only find items with the most trecent week. My DB is set up to set items with an ID for each week number, each week ID being higher than the previous. Is there a way I can insert a symbol in the "perform find" part of the script to only return the MAX number of week IDs? Thanks for the help!
mr_vodka Posted March 27, 2007 Posted March 27, 2007 You can create a self join relationship with the 'X' operator and then have Set Variable [$LastWeekNum; Max ( SelfJoin::ID )] Enter Find Mode [] Set Field [iD; $LastWeekNum] Perform Find [] But, doesnt it make more sense to do a search based off the current date minus how ever many days, rather than setting a field with the last week number?
working.account Posted March 27, 2007 Author Posted March 27, 2007 Is there a way to pull up the MAX record in a layout in Find Mode? Thanks!
comment Posted March 27, 2007 Posted March 27, 2007 No, not really. You have to be in Browse mode to look at data, and you need to store the piece of data you need for the find in a global field or in a variable, as John has shown. A somewhat simpler procedure, that doesn't require adding a relationship or anything: Show All Records Sort Records [ by weekfield, ascending ] Go to Record [ Last ] Set Variable [ $max ; weekfield ] Enter Find Mode Set Field [weekfield ; $max ] Perform Find []
Recommended Posts
This topic is 6452 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