Reid Posted August 26, 2010 Posted August 26, 2010 (edited) I have a schedule button that goes to the schedule layout. I'd like the button to do a search and return only the results for today if it is before 6:00 pm and for tomorrow if it is after 6:00 pm. Is there an IF function I can use for this? Just to clarify, I mean 6:00 pm actual time right now not the appointment times. Something like If (system time < 6:00 pm ; find date // ; // +1) Edited August 26, 2010 by Guest
Fitch Posted August 27, 2010 Posted August 27, 2010 Set Variable[ $now ; Get(CurrentTime) ] Set Variable[ $today ; Get( CurrentDate ) ] Set Variable[ $dateWanted ; Case( $now < Time(18;0;0) ; $today ; $today + 1 ) ] Perform Find( $dateWanted ) // using variable in Find requires FM11 Today will start at 12 am, does that work for you? Also you may want to use Get(CurrentHostTimestamp) if it's a hosted solution.
Reid Posted August 27, 2010 Author Posted August 27, 2010 Thanks so much for the help. I think I'm almost there. The last part when you perform the find...it says the provided find criteria is not valid when I run the script because I had it correlate the search field with the date field. When I create the find criteria it says "Find records when:" and then I have to pick a field that correlates with the criteria. $dateWanted is not one of the fields I can correlate to so I had it correlate to the date. how can I get around this?
Lee Smith Posted August 27, 2010 Posted August 27, 2010 What is the name and field type of the field you are searching?
Lee Smith Posted August 27, 2010 Posted August 27, 2010 How are you determining the Times, do you have a time field also? Lee
Reid Posted August 27, 2010 Author Posted August 27, 2010 Yes I have a time field that says when the appointment is. But all I need is for it to show the correct date which it looks like what you gave me works great! I'll let you know if different. Thanks so much for the help! I've learned a lot with you.
Recommended Posts
This topic is 5202 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