Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8756 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Does anyone know how to search a date field to find all dates in a particular month without using two global date fields, one for the beginning date and one for the ending date?

I would like to enter in one date and have a calculation figure out how to find all dates for the month of the entered date.

Posted

I can think of a way to do it without two global fields, but not without one.

Have the user enter a date into a global field called g_Search_Date. If your search field is called Date, then the script would be this:

Go to Layout [ Search Layout ]

Enter Find Mode []

Insert Calculated Result [ Date( Month( g_Search_Date ), 1, Year( g_Search_Date) ) & "..." & ( Date( Month( gSearch_Date ) + 1, 1, Year( g_Search_Date ) ) - 1 ) ]

Perform Find []

The firest Date function calculates the first day of the month that was entered. The elipsis signifies a date range. The second Date function calculates the last day in the current month (by finding the first day in the next month and subtracting one day).

Chuck

Posted

Errr, what about making a calculation field...

Month(date)

...or alternatively

MonthName(date)

...and just searching for the month number or name? Make a pop-up list with the month names in it to make the search easier.

Posted

Thanks for that Vaughan. For completeness, it would have to be...

Month(date) & Year (Date) for the calc field and you would have to parse the selection field to break out the month and year if it was a date field

or

have two drop down menus, one for month and one for year and then add them together to get your unique month/year search criteria.

Then there would be no confusion over November now and November later.

Posted

Originally posted by shierkev:

Does anyone know how to search a date field to find all dates in a particular month without using two global date fields, one for the beginning date and one for the ending date?

******************************************

Okay, this is really simple and it works for us. We needed to find out all the birthdays for the month of November, etc. We made our date field at text field and enter the dates as 11-02-00 or 11-16-2000, then in search, we just look for 11* and you will get all dates in November. Now the problem can appear when you have multiple years, then you must enter 11*2000. Also, be sure an put leading zeros on dates, i.e. 01-11-2000 if you need to sort these dates. In addition, we setup a date field that would copy the information to a text field, that way we had the best of both!

This topic is 8756 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.