cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Query builder - Maximum

Ilan_Mor
11-Garnet

Query builder - Maximum

Hi 

What is the right way to retrieve the Maximum (Last modified) date in Query builder?

I have tried this option (see picture) but didn't succeed 

Thanks 

Ilan.M

1 ACCEPTED SOLUTION

Accepted Solutions

Here's an example of using the Max function. I believe you can only use it in a Subselect.

 

This query will return info on the Part  with the highest value for "Persist.Info.Object.Identifier.Id"

joe_morton_0-1637764255302.png

joe_morton_1-1637764265749.png

joe_morton_2-1637764279708.png

joe_morton_3-1637764292271.png

joe_morton_4-1637764303417.png

joe_morton_5-1637764324761.png

 

 

 

 

 

 

View solution in original post

3 REPLIES 3

Maximum doesn't really work that way. You can return the maximum value for a number value, but not for a date.

 

If you just want to get the last modified version of a document, you can use a subselect to get the latest revision, and add the criteria to get the latest iteration. Since you have the latest version that typically should be the last modified of the document. 

 

If you wanted to be more sure to get the latest modified (again, I'll use a document as an example), you could do a subselect and return the maximum object persist ID. I believe Windchill assigns these numbers sequentially, so the maximum you get will be the most recent created. 

 

Hope that helps!

Hi Joe

I'm trying to understand how to use the Database function, so I tried to display maximum of 'Height' (defined as Real Number) ,but I got an error message (see attached picture).

What am I doing wrong?

 

thank you

Ilan .M

Here's an example of using the Max function. I believe you can only use it in a Subselect.

 

This query will return info on the Part  with the highest value for "Persist.Info.Object.Identifier.Id"

joe_morton_0-1637764255302.png

joe_morton_1-1637764265749.png

joe_morton_2-1637764279708.png

joe_morton_3-1637764292271.png

joe_morton_4-1637764303417.png

joe_morton_5-1637764324761.png

 

 

 

 

 

 

Top Tags