![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a database of advertisements. Each time i compile a report, I need to know the most recent date -- before today's -- that the advertisement was published. I tried setting a field mostRecentInsert equal to the following calculation: Max(Insertions::coverDate) < Get(CurrentDate) (Where Insertions is a related table tied to the advertisement) Unfortunately, for all advertisements (regardless of rather they have previous insertions or not) the field returns "?" Ideally, I'd like to have the field be a case statement that, in effect says if(mostRecentInserts is a valid date) //i can't find a funciton for this either { then show mostRecentInsert } else { show "new" } Any suggestions? Thanks |
#3
| |||
| |||
|
|
2) Create a second instance of the insertions table in the relationships graph. This second instance, placements2, would have *two* criteria for the relationship: a) advertisements::advertisement ID = placements::advertisement ID (just like the original insertions table) b) placements2::insertionDate < advertisements::today This effectively tells FileMaker to only consider dates less than today within this relationship. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Thanks Bill. The structure is already as you suggested; sorry if i wasn't clear there. I will try the 'second relationship' idea... I'm an SQL person so the idea of additional relationships is a little difficult for me to wrap my head around, but I understand your suggestion for the 2nd relationship. |
#6
| |||
| |||
|
|
chimpgrrl wrote: Thanks Bill. The structure is already as you suggested; sorry if i wasn't clear there. I will try the 'second relationship' idea... I'm an SQL person so the idea of additional relationships is a little difficult for me to wrap my head around, but I understand your suggestion for the 2nd relationship. Not a second relationship -- just a second condition on the same relationship. That is something you do all the time in SQL but that we in FileMaker have only been able to do since FM7. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Howard Schlossberg (818) 883-2846 FM Pro Solutions Los Angeles, California FileMaker 7 Certified Developer Associate Member, FileMaker Solutions Alliance |
#7
| |||
| |||
|
|
If she tries to add the second condition to the first relationship (advertisements<-->placements) she will break the usual link between the two tables. She has to add a second instance of the insertions table and a second relationship (advertisements<-->placements2) with the two criteria specified in order for it to work. So it is two lines, two relationships ![]() Bill "Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> wrote in message news:11kl60hjphcg53c (AT) corp (DOT) supernews.com... chimpgrrl wrote: Thanks Bill. The structure is already as you suggested; sorry if i wasn't clear there. I will try the 'second relationship' idea... I'm an SQL person so the idea of additional relationships is a little difficult for me to wrap my head around, but I understand your suggestion for the 2nd relationship. Not a second relationship -- just a second condition on the same relationship. That is something you do all the time in SQL but that we in FileMaker have only been able to do since FM7. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Howard Schlossberg (818) 883-2846 FM Pro Solutions Los Angeles, California FileMaker 7 Certified Developer Associate Member, FileMaker Solutions Alliance |
#8
| |||
| |||
|
|
Ok-- I admit I probably didn't read everything in its entirety, so I must've missed this point. Before I saw your original post, Bill, I had actually started my own reply that would have used GetNthRecord(). May or may not be a possibility for this situation. Bill Marriott wrote: If she tries to add the second condition to the first relationship (advertisements<-->placements) she will break the usual link between the two tables. She has to add a second instance of the insertions table and a second relationship (advertisements<-->placements2) with the two criteria specified in order for it to work. So it is two lines, two relationships ![]() Bill "Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> wrote in message news:11kl60hjphcg53c (AT) corp (DOT) supernews.com... chimpgrrl wrote: Thanks Bill. The structure is already as you suggested; sorry if i wasn't clear there. I will try the 'second relationship' idea... I'm an SQL person so the idea of additional relationships is a little difficult for me to wrap my head around, but I understand your suggestion for the 2nd relationship. Not a second relationship -- just a second condition on the same relationship. That is something you do all the time in SQL but that we in FileMaker have only been able to do since FM7. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Howard Schlossberg (818) 883-2846 FM Pro Solutions Los Angeles, California FileMaker 7 Certified Developer Associate Member, FileMaker Solutions Alliance -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Howard Schlossberg (818) 883-2846 FM Pro Solutions Los Angeles, California FileMaker 7 Certified Developer Associate Member, FileMaker Solutions Alliance |
![]() |
| Thread Tools | |
| Display Modes | |
| |