D
dp724 via AccessMonster.com
I have 2 SQLs that work individually to provide a single date in a drop down
combobox on my form (see below). How do I combine the 2 SQLs to setup a
single SQL statement to provide a date in the following scenario? If I select
a PSEID from the combobox and the PSEID is not found in the
TProgressExpenditures table; I then need the statement to use the TGoalDates
table to provide the date. The combined SQL should reference the
TProgressExpenditures table first for a PSEID and the date of the last
expenditure or else use that PSEID's last AwardDate in the TGoalDates.
SELECT TProgressExpenditures.PSEID, Format(Last(DateAdd("m",1,[month])),"mmm-
yyyy") AS Months
FROM TProgressExpenditures
GROUP BY TProgressExpenditures.PSEID
HAVING (((TProgressExpenditures.PSEID)=[Forms]![Update Progress &
Expenditures]![cboPSE]));
SELECT TGoalDates.PSEID, Format(Last(DateAdd("m",1,[AwardDate])),"mmm-yyyy")
AS Months
FROM TGoalDates
GROUP BY TGoalDates.PSEID
HAVING (((TGoalDates.PSEID)=[Forms]![Update Progress & Expenditures]![cboPSE])
);
Any help solving this problem is really appreciated.
combobox on my form (see below). How do I combine the 2 SQLs to setup a
single SQL statement to provide a date in the following scenario? If I select
a PSEID from the combobox and the PSEID is not found in the
TProgressExpenditures table; I then need the statement to use the TGoalDates
table to provide the date. The combined SQL should reference the
TProgressExpenditures table first for a PSEID and the date of the last
expenditure or else use that PSEID's last AwardDate in the TGoalDates.
SELECT TProgressExpenditures.PSEID, Format(Last(DateAdd("m",1,[month])),"mmm-
yyyy") AS Months
FROM TProgressExpenditures
GROUP BY TProgressExpenditures.PSEID
HAVING (((TProgressExpenditures.PSEID)=[Forms]![Update Progress &
Expenditures]![cboPSE]));
SELECT TGoalDates.PSEID, Format(Last(DateAdd("m",1,[AwardDate])),"mmm-yyyy")
AS Months
FROM TGoalDates
GROUP BY TGoalDates.PSEID
HAVING (((TGoalDates.PSEID)=[Forms]![Update Progress & Expenditures]![cboPSE])
);
Any help solving this problem is really appreciated.