chzboi Posted August 26, 2003 Posted August 26, 2003 Im trying to create a script that will search for a specific date range (example: 4-1-03...5-1-03) in two different date fields. I've set up a script that does this in a step one step two process, but I would like to have the user input the date/date range only once. The results would be stored in global fields. here is what I am using now... Enter Find Mode [ Pause ] Perform Find [ Replace Found Set ] Insert Calculated Result [ SFC_Global_1, Status Found Count ] Enter Find Mode [ Pause ] Perform Find [ Replace Found Set ] Insert Calculated Result [ SFC_Global_2, Status Found Count ] I tried using a combined Calc field, as stated elsewhere in the forums, to combine the two date fields in order to search from it, but I couldn't get the calc field to work properly with displaying two dates. Any advice would be appreciated!
-Queue- Posted August 26, 2003 Posted August 26, 2003 Have user enter beginning and ending dates in two global fields in Browse Mode. Go to Layout {with your date fields on it} Enter Find Mode[] Insert Calculated Result[ datefield1, g1 & "..." & g2] New Record/Request Insert Calculated Result[ datefield2, g1 & "..." & g2] Perform Find
kenneth2k1 Posted August 26, 2003 Posted August 26, 2003 Hello: The script you posted seems to have nothing to do with what you are trying to accomplish. Also, what do you mean by "the results will be stored in globals? Anyways, I will try to answer the question that you posted: "Im trying to create a script that will search for a specific date range (example: 4-1-03...5-1-03) in two different date fields" There are a few things you will need to define: 1. The date field that you want to search in. I'll call it date. 2. The globals that will hold the range you want to search. I'll call them g_fromDate and g_toDate. Construct your script: Go to Layout [Layout with date fields on it] Enter Find Mode [] Insert Calculated Result [date1, "DateToText(g_fromDate) & "..." & DateToText(g_toDate) Perform Find [] This will set the field "date" to the range set in the globals g_fromDate and g_toDate. So users will enter the date ranges, then perform the above script. ken
kenneth2k1 Posted August 26, 2003 Posted August 26, 2003 I was going to reply with that, too JT. But I wasn't sure if he meant there are two date fields to find in, or if the ranges were in two date fields. I came in 2nd again! ken
-Queue- Posted August 26, 2003 Posted August 26, 2003 I thought his explanation was too confusing. So instead of trying to interpret his script, I took the lazy route and told him what to do instead.
chzboi Posted September 2, 2003 Author Posted September 2, 2003 I'm sorry I wasn't able to explain it better. I give your examples a try, thanks for the help!!
chzboi Posted September 8, 2003 Author Posted September 8, 2003 kenneth2k1, Your script worked. Although I originally wanted the user to just type in a date range in one field (1-1-03...2-2-03) to get a result for two different date fields, your method of using two global fields to represent the beginning and ending dates works fine. Thanks for both of your input!
Recommended Posts
This topic is 8087 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