Joseph31 Posted February 17, 2005 Posted February 17, 2005 I have a portal with two fields: Years & Date I would like a function that would return the longest time in years along with the date associated with it. Example: PORTAL: (Years) (Date) 2 1-5-05 4 5-6-05 Would like 4 & 5-6-05 Returned on the main page. Help please Joseph
Joseph31 Posted February 17, 2005 Author Posted February 17, 2005 Let me explan a little more on this: I have a main Table with some calculation on it -- on this main table I have a portal that I type in two fields "Years" & "Date". What I would Like to do is to beable to pull off to the main table from the portal the longest time in "years" along with the "date" associated with it. Notes: There can be many entries into this portal. I need it to look down the full list. Joseph
merlyn383 Posted February 17, 2005 Posted February 17, 2005 How are your two tables currently related?
merlyn383 Posted February 17, 2005 Posted February 17, 2005 What do those relation fields signify? Can you tell us a little bit more about your database, maybe post an attachment? I'm having a hard time wrapping my mind around your current setup.
comment Posted February 17, 2005 Posted February 17, 2005 In Edit Relationship, make your relationship sort by Years, descending (in the portal setup, select another sort, if you like). In the main table layout, put the Years and the Date fields from the related table on the layout - anywhere outside the portal. These will show the data from the related record that has the maximum value in Years.
transpower Posted February 17, 2005 Posted February 17, 2005 Max ( RelatedTable::Years_Date ) where Years_Date = Years & " " & Date in the Related Table.
Joseph31 Posted February 17, 2005 Author Posted February 17, 2005 Let me see if I can explan. Main Table: RecordID First Name: Last Name: Address: Also a Portal: Named "LE" This portal is as you know another table "LE" LE Table: RecordID Rel_RecordID LE_Years LE_Date Relationships: RecordID -- Rel_RecordID So what happens is that I full in a a new record with Name, address etc... Then what I do is I can type into the portal with very spefic reports -- like LE_Years and the date it came in. There can be many lines in this portal. What I wanted to do is to be able to pull out the largest LE_Year in the Portal that is just a max function I know how to do this... This is the hard part... I want to pull out along with the LE_Year number the date that it was enterd -- LE_Date. Joseph
comment Posted February 17, 2005 Posted February 17, 2005 Quote Max ( RelatedTable::Years_Date ) where Years_Date = Years & " " & Date in the Related Table. IMHO, that's not going to work.
Recommended Posts
This topic is 7313 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 accountSign in
Already have an account? Sign in here.
Sign In Now