B
Bob Dolmetsch
I have a query as below meant to select the most recent
scan for this patient and evaluate the CRL (Crown-Rump
length for a fetus):
SELECT Growth.SSN, Max(Growth.[SCAN DATE]) AS [MaxOfSCAN
DATE], Growth.[PREGNANCY NUMBER], Growth.[INFANT NUMBER],
Growth.Crl INTO backGrowth
FROM Growth
GROUP BY Growth.SSN, Growth.[PREGNANCY NUMBER], Growth.
[INFANT NUMBER], Growth.Crl
HAVING (((Growth.SSN)=[forms]![growth screen1]![ssn]) AND
((Max(Growth.[SCAN DATE]))<CDate([forms]![growth screen1]!
[scan date])) AND ((Growth.[PREGNANCY NUMBER])=[forms]!
[growth screen1]![pregnancy number]) AND ((Growth.[INFANT
NUMBER])=[forms]![growth screen1]![infant number]) AND
((Growth.Crl) Is Not Null));
This is the second scan for the current patient during the
current pregnancy;
I can see the records in table view. I've retyped the
data to confirm that it is typed correctly and yet the SQL
does not find the first record.
Can anyone suggest why?
(the current date is 10/13/2003; the next previous record
is for 10/06/2003; CRL is .4 in both records.
scan for this patient and evaluate the CRL (Crown-Rump
length for a fetus):
SELECT Growth.SSN, Max(Growth.[SCAN DATE]) AS [MaxOfSCAN
DATE], Growth.[PREGNANCY NUMBER], Growth.[INFANT NUMBER],
Growth.Crl INTO backGrowth
FROM Growth
GROUP BY Growth.SSN, Growth.[PREGNANCY NUMBER], Growth.
[INFANT NUMBER], Growth.Crl
HAVING (((Growth.SSN)=[forms]![growth screen1]![ssn]) AND
((Max(Growth.[SCAN DATE]))<CDate([forms]![growth screen1]!
[scan date])) AND ((Growth.[PREGNANCY NUMBER])=[forms]!
[growth screen1]![pregnancy number]) AND ((Growth.[INFANT
NUMBER])=[forms]![growth screen1]![infant number]) AND
((Growth.Crl) Is Not Null));
This is the second scan for the current patient during the
current pregnancy;
I can see the records in table view. I've retyped the
data to confirm that it is typed correctly and yet the SQL
does not find the first record.
Can anyone suggest why?
(the current date is 10/13/2003; the next previous record
is for 10/06/2003; CRL is .4 in both records.