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

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

Recommended Posts

Posted

Hi all

I can find the min and max date a welder has welded, but i also need to find the date before the max date.

example:

Terry welds on 1/3/05

3/6/05

4/6/05

5/6/05

7/24/05

8/23/05

I can find the first date using "min" and the last date using "max" but i can not figure out how to find the date before "max" which would be "7/24/05".

Any ideas and suggest would be greatly appreciated

Thnaks in advance

Lionel

Posted (edited)

Show All Records 

Set Error Capture [ On ] 

Enter Find Mode [  ] 

Show Custom Dialog [ Title: "Oi Dude"; Message: "Enter name of the welder"; Buttons: "OK"; Input #1: Untitled::WelderName ] Perform Find [  ] 

Sort Records [ Specified Sort Order: Untitled::Days; ascending ] [ Restore; No dialog ] 

Set Error Capture [ Off ] 

If [ Get ( FoundCount ) > 2 ] 

     Go to Record/Request/Page [ First ] 

     Omit Multiple Records [ Get ( FoundCount ) - 2 ] [ No dialog ] 

     Go to Record/Request/Page [ Next ] 

     Omit Record 

Else 

     Show Custom Dialog [ Title: "Error!"; Message: "Nothing found"; Buttons: "OK" ] 

End If 




Dang ...you're on 6.0 then do you have to...




Show All Records 

Set Error Capture [ On ] 

Enter Find Mode [  ] 

Show Custom Dialog [ Title: "Oi Dude"; Message: "Enter name of the welder"; Buttons: "OK"; Input #1: Untitled::WelderName ]

Perform Find [  ] 

Sort Records [ Specified Sort Order: Untitled::Days; ascending ] [ Restore; No dialog ] 

Set Error Capture [ Off ] 

If [ Get ( FoundCount ) > 2 ] 

    Go to Record/Request/Page [ Last ] 

    Omit Record 

    Loop 

            Go to Record/Request/Page [ Previous; Exit after last ]

            Omit Record 

    End Loop 

Else 

Show Custom Dialog [ Title: "Error!"; Message: "Nothing found"; Buttons: "OK" ] 

End If 

--sd

Edited by Guest
Posted

Define a value list "Dates", using values from the date field, include only related values, starting from your welders table.

Then, in the welders table define a calculation field (unstored, result is date) =

Let ( [

list = ValueListItems ( Get (FileName) ; "Dates" ) ;

last = ValueCount ( list )

] ;

GetAsDate ( MiddleValues ( list ; last - 1 ; 1 ) )

)

Posted

Oh, version 6, bummer - I don't even know which functions are available in 6.

Try:

Middle(

ValueListItems(Status(CurrentFileName). "Dates") ,

Position(

ValueListItems(Status(CurrentFileName), "Dates") , "¶" , 1 , PatternCount( ValueListItems(Status(CurrentFileName), "Dates") , "¶") - 1 ) + 1 ,

Position(

ValueListItems(Status(CurrentFileName), "Dates") , "¶", 1, PatternCount( ValueListItems(Status(CurrentFileName), "Dates") , "¶") )

- Position(

ValueListItems(Status(CurrentFileName), "Dates") , "¶" , 1 , PatternCount( ValueListItems(Status(CurrentFileName), "Dates") , "¶") - 1 ) - 1

)

Posted (edited)

Dear me Comment....Hows about




RightWords(

Substitute(ValueListItems(Status(CurrentFileName), "Dates"); 

RightWords(ValueListItems(Status(CurrentFileName), "Dates");

 3); ""); 3)

If we're to be in almost excell mode B)

--sd

Edited by Guest
Posted (edited)

I have stayed away from counting words, because the result depends on the date format. In pre-7 versions:

8/25/2005 = 3 words;

25-8-2005 = 3 words;

but

25.8.2005 = 1 word.

---

I am sorely tempted to accuse you of being an Americano-centrist and ignoring the rest of the world!!!

Edited by Guest
Posted

I am sorely tempted to accuse you of being an Americano-centrist and ignoring the rest of the world!!!

Good grief, couldn't I pursuade you to call me "Daft as a brush" instead ...the other is unbearable B) : : :B:B - But the script then, it had some bite didn't it???

--sd

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