G
Guest
given: i am using a2k.
i have a form which has a txtcontrl that is either 'Yes' or 'No' called
LTFU. if LTFU is 'Yes' then (i think) the on current event VBA will enter
the results of
SELECT [Patients on F/U].[Last Name], [Patients on F/U].MR_Number,
Schedules.[IRB#],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate]))) AS [Next F/U Due3], MasterTable.Months
FROM Schedules INNER JOIN (MasterTable INNER JOIN [Patients on F/U] ON
MasterTable.[Dummy Number] = [Patients on F/U].[Dummy Number]) ON
(Schedules.[IRB#] = [Patients on F/U].[IRB#]) AND (Schedules.Visit =
MasterTable.Months)
ORDER BY [Patients on F/U].[Last Name],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate])));
into a control called something like 'FollowUpDate'
if/when LTFU is coded 'No' then 'FollowUpDate' will get the valued of
'FollowUpDate' using
SELECT [Test of Query1].[Last Name], [Patients on F/U].MR_Number, [Test of
Query1].[IRB#],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate]))) AS [Next F/U Due3], MasterTable.Months
FROM ([Patients on F/U] INNER JOIN [Test of Query1] ON [Patients on
F/U].[IRB#] = [Test of Query1].[IRB#]) INNER JOIN MasterTable ON [Patients on
F/U].[Dummy Number] = MasterTable.[Dummy Number]
ORDER BY [Test of Query1].[Last Name], MasterTable.Months;
i know that these are hairy looking SQL strings, but leaving aside for the
moment the 'deep' meaning of each', is it possible to clue me in on what the
overriding principle would be (using perhaps a simpler representation of two
separate SELECT queries)?
tia!
i have a form which has a txtcontrl that is either 'Yes' or 'No' called
LTFU. if LTFU is 'Yes' then (i think) the on current event VBA will enter
the results of
SELECT [Patients on F/U].[Last Name], [Patients on F/U].MR_Number,
Schedules.[IRB#],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate]))) AS [Next F/U Due3], MasterTable.Months
FROM Schedules INNER JOIN (MasterTable INNER JOIN [Patients on F/U] ON
MasterTable.[Dummy Number] = [Patients on F/U].[Dummy Number]) ON
(Schedules.[IRB#] = [Patients on F/U].[IRB#]) AND (Schedules.Visit =
MasterTable.Months)
ORDER BY [Patients on F/U].[Last Name],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate])));
into a control called something like 'FollowUpDate'
if/when LTFU is coded 'No' then 'FollowUpDate' will get the valued of
'FollowUpDate' using
SELECT [Test of Query1].[Last Name], [Patients on F/U].MR_Number, [Test of
Query1].[IRB#],
IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=7,DateAdd("m",[Months],[RegisteredDate])-1,IIf(DatePart('w',DateAdd("m",[Months],[RegisteredDate]))=1,DateAdd("m",[Months],[RegisteredDate])+1,DateAdd("m",[Months],[RegisteredDate]))) AS [Next F/U Due3], MasterTable.Months
FROM ([Patients on F/U] INNER JOIN [Test of Query1] ON [Patients on
F/U].[IRB#] = [Test of Query1].[IRB#]) INNER JOIN MasterTable ON [Patients on
F/U].[Dummy Number] = MasterTable.[Dummy Number]
ORDER BY [Test of Query1].[Last Name], MasterTable.Months;
i know that these are hairy looking SQL strings, but leaving aside for the
moment the 'deep' meaning of each', is it possible to clue me in on what the
overriding principle would be (using perhaps a simpler representation of two
separate SELECT queries)?
tia!