Re: Refining query
- From: SMT <SMT@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Apr 2008 09:06:03 -0700
Hello,
Thanks for the reponse. I tried the top code. I selected 3/28 in my
Forms!frmRptQuery!Combo0 and it only pulled two records which had a
completed date of 4/11/08. I need to show every project (record) and for
those that do not have any input for 3/28 I need to still show the latest
record for that project and for those that have a completed date filled in I
want to show the latest record for those that have a completed date but not
more than 14 days past the date chosen in the Forms!frmRptQuery!Combo0. Does
that help?
"Gary Walter" wrote:
Hi SMT,.
- a reporting period of (combo0) to (combo0 +14) ?
- only completed records (actual_complete_date is not null)?
WHERE
((
(F.DateID)=
(SELECT Max(X.DateID)
FROM funding_history AS X
Where
(X.DateID >= Forms!frmRptQuery!Combo0
AND
X.DateID < Forms!frmRptQuery!Combo0 + 15)
AND
X.actual_complete_date IS NOT NULL
AND
X.proj_exec_id=F.proj_exec_id )
));
or do you no longer want just the single latest record
for a project?
WHERE
((
(F.DateID) IN
(SELECT X.DateID
FROM funding_history AS X
Where
(X.DateID >= Forms!frmRptQuery!Combo0
AND
X.DateID < Forms!frmRptQuery!Combo0 + 15)
AND
X.actual_complete_date IS NOT NULL
AND
X.proj_exec_id=F.proj_exec_id )
));
"SMT" wrote:
Hello thanks for the fast response. I still dont think I am explainingthis
in the best way. The original query allows the user to pull the projectof
status by the dateid using the Forms!frmRptQuery!Combo0 (which is a list
all the submission dates). If say April 11 was chosen and there was noinput
for April 11 then the query choses the lastest record for that project,say
March 28. The reports are suppose to be done every two weeks but thatoften
doesnt happen so as in the case above the lastest entry is shown and thatthe
existing query (copied below) performs this well. I had to add an
actual_complete_date and now my supervisor wants the completed records to
show for 1 reporting period or 14 days after the date selected in the
Forms!frmRptQuery!Combo0. That is the piece I cant seem to get added to
query. I appreciate any suggestions.ask it
Thanks
"Jerry Whittle" wrote:
WHERE (((F.DateID - 14) >=(SELECT Max(X.DateID)
FROM funding_history AS X
Where X.DateID <= Forms!frmRptQuery!Combo0
AND X.proj_exec_id=F.proj_exec_id
Test the above.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
"SMT" wrote:
I asked this question before and didnt get reponse but I think I didnt
(seeproperly nor provide the appropriate information. I am hoping to have
explained it better this time.
I have a query which selects the most recent record that works great
havebelow) I want to refine that query to also show me those records which
chosenactual_complete_date that is less than or equal to 14 days from date
Project,in Forms!frmRptQuery!Combo0.
SELECT PM.proj_mgr_branch AS [Proj Mgr Code], P.project_title AS
RiskPM.proj_mgr_name AS [Proj Mgr Name], P.proj_risk_level AS [Project
ASLevel], C.cust_adv_name AS [Customer Advocate], E.ee_description AS
[Enterprise Executive (EE)], F.planned_funding AS [Funding to spend in
FY07($K) (From Carryover & New Orders)], F.bcwp AS [BCWP ($K)], F.bcws
AS[BCWS ($K)], F.acwp AS [ACWP ($K)], IIf([bcwp]<>0 And
([bcws])<>0,CDbl([bcwp])/CDbl([bcws])) AS SPI, IIf([bcwp]<>0 And
([acwp])<>0,CDbl([bcwp])/CDbl([acwp])) AS CPI, F.method_of_calculation
[SPI[Method of Calculation], F.comments AS Comments, F.spi_narrative AS
JOINNarrative], F.cpi_narrative AS [CPI Narrative], F.carryover_funds AS
[Estimated Carry-over ($k)], F.actual_complete_date AS Completed
FROM project_manager AS PM INNER JOIN (enterprise_executive AS E INNER
INNER JOIN(customer_advocate AS C INNER JOIN (project_execution_metrics AS P
C.cust_adv_id =funding_history AS F ON P.proj_exec_id = F.proj_exec_id) ON
WhereP.cust_adv_id) ON E.ee_id = P.ee_id) ON PM.proj_mgr_id = P.proj_mgr_id
WHERE (((F.DateID)=(SELECT Max(X.DateID) FROM funding_history AS X
X.proj_exec_id=F.proj_exec_idX.DateID <= Forms!frmRptQuery!Combo0 AND
)));
- Follow-Ups:
- Re: Refining query
- From: Gary Walter
- Re: Refining query
- References:
- Refining query
- From: SMT
- RE: Refining query
- From: Jerry Whittle
- RE: Refining query
- From: SMT
- Re: Refining query
- From: Gary Walter
- Refining query
- Prev by Date: RE: find the query that made a table.
- Next by Date: Query totaling one field for unique values
- Previous by thread: Re: Refining query
- Next by thread: Re: Refining query
- Index(es):
Relevant Pages
|
Loading