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

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

Recommended Posts

Posted

Hi guys, this is the last thing I need to do to finish my system, and I am completely stuck, even my coordinator has no idea.

Basically I have a layout which calculates how much each "Department" is spending, through summary fields and a currently basic script

The idea is that the user enters the department and the date (drop down calender) they want the results to be shown from.

So far the script works in working out the "Total Cost" when searching by Department alone, but when searching with the "Date Range" as well, unless there is a record with that matches that date exactly, no results are found.

So what I was wondering if there was a way for the script to detect the date range and show records that were created after that date?

The script I have so far is:

1. Go to layout - Departmental Spending

2. Enter Find Mode

3. Perform Find

4. Set Field(Courses Attended; Get ( FoundCount )

6. Go to layout - Add to Record

5. Go to layout - Departmental Spending

Any help would be fantastic :)

Posted

how are you entering in the date range? You only have 1 date field...

Well you can script it for > 2/01/2008 and < 2/20/2008.

Enter Find Mode []

Set Field [ Department; "yourDept" ]

Set Field [ Date; ">2/01/2008" ]

Duplicate Record []

Set Field [ Date; "<2/20/2008" ]

Perform Find []

IF you have global fields for your search fields then you can do something like...

Enter Find Mode []

Set Field [ Department; gDept ]

Set Field [ Date; ">" & gDateStart ]

Duplicate Record []

Set Field [ Date; "<" & gDateEnd ]

Perform Find []

Posted

The script with two requests “> 2/01/2008” and “< 2/20/2008” will actually find “ > 2/01/2008” OR “< 2/20/2008”. A correct way to search for date range is to use the “..” operator:

2/01/2008..2/20/2008

It's inclusive, i.e. end dates are also included. In modern versions if the date range is exactly a month or a year, it's possible to use a wildcard like:

2/*/2008; */*/2008.

Posted (edited)

I have a current date field which is a global field.

I attempted what you said, but the script just halted and when I press continue it just pressed me with the same results as before, I'm not sure I did it right so I've posted a screenshot below.

Untitled-1-1.jpg

Still a bit of a novice really

Thanks for your help so far.

Edited by Guest
Posted

:) Oops I dont know what I was thinking there or why I didnt post with date range ellipses... I cant for the life of me remember why I posted it that way... with or finds... The only thing I remember was that he had only one date field... Oh well, chalk one up for embarrassing.

Posted

My comment was directed at Mikhail's correction. I am still confused about your setup. In your orig post you seem to mention only one date field. What date range are you looking for?

Posted

I have two date fields, "Current Date" which is filled automatically by Get(CurrentDate). With a Date Range field. The idea is that a user can select a date from the past combined with the department and find records that have been created since that date.

I know I'm confusing myself, hope this clears things up somewhat :)

Thanks

Posted

Ok that clears up things a lot. So basically all you need is:

Enter Find Mode []

Set Field [ Department; gDept ]

Set Field [ Date; "≥" & gDateStart ]

Perform Find []

This will find all records that are newer or equal to the date that you have selected as for the department that you selected. You do not need the second date field. Make sure that both the selection fields are global.

Posted

I'm not sure what I'm doing wrong here but the script is still pausing and then producing the wrong results when I click continue.

Untitled-2.jpg

Sorry if I'm being awkward, this one seems so simple but is throwing me completely

Posted

Well i cant see any of your images for some reason. Maybe due to firewall and where your images are stored.

uncheck the Pause for Enter Find Mode

Posted

Oh really?

Maybe a direct link will work:

I've unchecked it but it still shows all of the records under that department, if the date range was working it should only show one

Posted

I cant get to photobucket... Anyway, are you sure that your search Date field is a global date?

This topic is 6121 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.