new comer Posted August 21, 2003 Posted August 21, 2003 Greeting! I'm setting up a searching script to allow user searching in a date range. I use two global date fields to hold the beginning date and the finishing date. The problem is: I cannot enter anything in these two fields in find mode.
kenneth2k1 Posted August 21, 2003 Posted August 21, 2003 Welcome! Finding in globals won't work. Know why? Because globals are the same for all records. You want to enter the dates in these globals, then go into find mode If you want to find a date range of one field from two globals, you would want to do something like this: Go to Layout [Layout that the date field is on] Enter Find Mode [ ] Insert Calculated Result ["Date field you want to find in" , "DateToText(g_datefield1) & "..." & DateToText(g_datefield2) Perform Find [] Where g_datefield 1 and 2 are your two global date fields I just did this off the top of my head, so make sure you test it. Ken
new comer Posted August 21, 2003 Author Posted August 21, 2003 Thanks Ken. So it means I cannot put other fields (not global) in the same layout.
kenneth2k1 Posted August 21, 2003 Posted August 21, 2003 You can put any fields you want on any layout
-Queue- Posted August 21, 2003 Posted August 21, 2003 You would want a specific layout with only those globals used for your find criteria, yes. Otherwise, you run the risk of changing valid data in other fields.
new comer Posted August 22, 2003 Author Posted August 22, 2003 Thanks Queue. guess I have to use a calendar instead of manually enter date. b/c I need to put some other fields with these two.
-Queue- Posted August 22, 2003 Posted August 22, 2003 Well, you could put nonglobals on the same layout, but you'll want to disallow entry, to prevent them from being accidentally modified.
BobWeaver Posted August 24, 2003 Posted August 24, 2003 It seems to me that this question has gotten a bit off track. To search for a date range, you can enter the start and end dates in global fields while you are in browse mode. Then, run a script that switches to find mode, and possibly switches to another layout with the actual date field that you want to search. Then use the "Insert Calculated Result" script step to pu the find criteria into the date field: Enter Find mode Go to Layout [DateFindLayout] Insert Calculated result [DateField, gStartStart & "..." & gEndDate] Perform find Go to Layout [original layout]
-Queue- Posted August 25, 2003 Posted August 25, 2003 This was already explained, and further questions were closely related and hardly off-track for this to perform as desired without screwing up existing data. So why the need for a duplicate post?
BobWeaver Posted August 25, 2003 Posted August 25, 2003 Guilty as charged. I brought it up again partly because the thread got long enough that I had forgotten Ken's original explanation, and also it appeared that there had been some comments that had misled Newcomer into thinking that (s)he needed to do something a lot more complicated than necessary.
kenneth2k1 Posted August 25, 2003 Posted August 25, 2003 Yes, I was thrown off by the whole "Can I not put fields other than global fields on the layout?" question. I have two globals set up in the upper right corner of my layouts - a sort of quick range find. So in this case, the globals can be on the same layout as the other fields. JT seems to be talking more about a search layout, in which case it is good to use all globals and set your fields to their values. Ken
-Queue- Posted August 26, 2003 Posted August 26, 2003 Agreed, I was just trying to help prevent what sounded like a catastrophe in the works.
Recommended Posts
This topic is 7759 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