kareng Posted April 8, 2002 Share Posted April 8, 2002 I have a script written to preform a find of a date entered by the user. They can put one date or a date range (separated by ...) Some of the users requested not having to do the ... to separate the range of dates. Is there a way around that? I tried making two separate fields - date one and date two and writing a calculation that takes date one & "..." & date two and putting them into a separate field - that did not work. If anyone has any ideas I would appreciate it. Thanks Quote Link to comment Share on other sites More sharing options...
Robert Schaub Posted April 9, 2002 Share Posted April 9, 2002 Create fields FindDate1 = Date FindDate2 =Date Create a Field called TwoDateFind = calc= FindDate1 & "..." & FindDate2 Create find layout with 2 date fields Script attached to find button in Data layout Goto to layout [Find Date] Enter find mode[pause] Set field [YourDateField, TwoDateFind] Perform Find [ ] Go to Layout [Original] In your Find Date layout Enter text uder the 2 Fields "Enter Date 1 and Date 2 in the fields above ,Then Press Enter" When they press enter it re-activates the find that we put in pause in the script Also See http://www.fmfiles.com/newtips.html look for Last 24 Hours - This tip file will find date and time ranges for you, and it will also find all records within the last 24 hours. This is a file I created and is unlocked . Inside you will find an example of the above post Quote Link to comment Share on other sites More sharing options...
dj Posted April 10, 2002 Share Posted April 10, 2002 Create fields FindDate1 = Date FindDate2 =Date Create a Field called TwoDateFind = calc= FindDate1 & "..." & FindDate2 Create find layout with 2 date fields Script attached to find button in Data layout Goto to layout [Find Date] Enter find mode[pause] Set field [YourDateField, TwoDateFind] Perform Find [ ] Go to Layout [Original] This won't work First, cause the calc field would never avaluate in find mode so you can't say Set field [YourDateField, TwoDateFind], where Datefind is an calc field even if FindDate1and FindDate2 were globals (in which case you wouldn't be even able to enter any data in find mode). The only way you could use calc in Find Mode is script step "Insert Calculated Result" But, here comes the second point, even if you use this step whit above calculation it won't still work. The reason why is that the result of calculation is not an valid date so you can not use it with any "Set" function on an date field. BTW the above calc would convert FindDate1 and FindDate2 in numbers and than it would concatenate them (with "..." between them) But neither using DateTotext before won't work. So only way that I know is to use copy and paste. Goto to layout [Find Date] Enter find mode[pause] Copy[FindDate1] Paste[yourDate,select] PaseLiteral[yourDate,"..."] //without selection Copy[FindDate2] Paste[yourDate]//without selection Perform Find [ ] Go to Layout [Original] HTH Dj Quote Link to comment Share on other sites More sharing options...
kareng Posted April 10, 2002 Author Share Posted April 10, 2002 DJ Your solution worked - except I had to cut not copy - otherwise that info also remained in the find. Chopper Your solution would not work for a date range that included multiple months or different years. But it worked for single month in a one year. Thanks for you help! Karen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.