A
accessvet
Dear list,
I have 2 tables:
Table1 has SampleCollectionDate; and
Table2 has DateGaveBirth, DateStoppedLactating and DateGaveBirthNext.
Both tables linked together in a select query.
I want to return 1 if DateGaveBirth<SampleCollectionDate<DateStopedLactating,
or return 2 if DateStopedLactating<SampleCollectionDate<DateGaveBirthNext.
Using a IIF statements, I was able to do that for Table1 records that have 1
record only in Table 2 but when it came to cases with several lactation
records in Table 2 I got incorrect values, specifically all 1s although I
should be getting 2s.
The 1 and 2 are to identify when was a sample collected in a record.
I tried to use DLookup, Dfirst but was not able to apply them.
Any help is greatly appreciated.
I have 2 tables:
Table1 has SampleCollectionDate; and
Table2 has DateGaveBirth, DateStoppedLactating and DateGaveBirthNext.
Both tables linked together in a select query.
I want to return 1 if DateGaveBirth<SampleCollectionDate<DateStopedLactating,
or return 2 if DateStopedLactating<SampleCollectionDate<DateGaveBirthNext.
Using a IIF statements, I was able to do that for Table1 records that have 1
record only in Table 2 but when it came to cases with several lactation
records in Table 2 I got incorrect values, specifically all 1s although I
should be getting 2s.
The 1 and 2 are to identify when was a sample collected in a record.
I tried to use DLookup, Dfirst but was not able to apply them.
Any help is greatly appreciated.