Sign in to follow this  
Followers 0

Find a previous Year


13 posts in this topic

Posted

I would like to have a pull down or even a selct list to click on to have the system go out and find previous year. I already have a script for current year. thanks in advance.

Share this post


Link to post
Share on other sites

Posted

in a date field find

*/*/2011

Share this post


Link to post
Share on other sites

Posted

in a date field find

*/*/2011

the only problem i need it to do this every year without me putting the year in....

Year ( Get ( CurrentDate ) ) - 1 does not work on 7 it does however put the right year but the find does not work

Share this post


Link to post
Share on other sites

Posted

Try:

Enter Find Mode []

Set Field [ YourTable::Datefield ; Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) ) - 1 ) & "…" & Date ( 1 ; 0 ; Year ( Get ( CurrentDate ) ) ) ]

Perform Find []

Share this post


Link to post
Share on other sites

Posted

Michael, I am wondering why Year ( Get ( CurrentDate ) ) - 1 would not work. It works in my tests ... just entering the year itself into a date field finds all records within that year. And I know that YOU know it ... so why did it fail for agaperrk? And why are you providing a range instead?

Never mind. Version 7 ... I just opened it and tried and it doesn't work! I did not know this functionality wasn't in 7!

Share this post


Link to post
Share on other sites

Posted

GetAsText(Date( 1; 1; Year(Get(CurrentDate)) )) & "..." & GetAsText(Date( 12; 31; Year(Get(CurrentDate)) )) This gets me the current year.. I guess i could use a minus 1 after the current date.

Share this post


Link to post
Share on other sites

Posted

Are you asking, answering?

Share this post


Link to post
Share on other sites

Posted

I was just showing that i had the current year done but I am having issues with the Previous Year.

Share this post


Link to post
Share on other sites

Posted

And my post #4 above ... ?

Share this post


Link to post
Share on other sites

Posted

I was just pointing out that i have the current year and it does not work for me just to add a minus 1 unless there is a new way to do it........ I'm still looking for a solution for the previous year.

Share this post


Link to post
Share on other sites

Posted

OK, I'll ask again: have you seen my suggestion in post #4 of this thread? It is supposed to provide a solution for finding records from previous year.

Share this post


Link to post
Share on other sites

Posted

agaperrik, why are you wrapping with GetAsText()? You should be able to take Comment's calculation and just put it in the calculation dialog box exactly (copy it) as:

Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) ) - 1 ) & "…" & Date ( 1 ; 0 ; Year ( Get ( CurrentDate ) ) )

You are searching a date field, correct? This doesn't need a drop-down list or anything else ... it will always change and always get the year prior to the current one in a regular Find script. :laugh2:

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0