F
FerryMary
In an attempt to not store a calculated result I need to alter the following
query so all records are reflected. Guidance,f rom MVP Jeff, was alternative
to storing a calculation, by using combobox at top of form. I like this,
since everything I read says not to store one. But since my query is based
on "Max" it returns wrong value for older records. Following is what I have
and what I want:
What I Have:
The following Query produces the ReportNo that I prefer, but only only on
max records. When I try to alter it to show all records I wind up with a
result of 1 in each case. (I think I need a running count, but just can't
get it)
SELECT Max(tblJob.JobNumber) As MaxOfJobNumber,
Format(tblJob.VesselID,"000") &
Format(tblJob.InitiatedDate,"yy") &
Format(tblStatus.JobType) &
Format(Count(tblStatus.Jobtpe),"0000") As ReportNo,tblJob.VesselID
FROM tblStatus INNER JOIN tblJob ON tblStatus.StatusED
GROUP BY tblJob.Vessel,(tblStatus.JobType),Format(tblJob.VesselID,"000") &
Format(tblJob.InitiateDate,"yy")
ORDER BY Max(tblJob.JobNumber) DESC;
That query is an alteration of query worked out for me by Chris2(another
generous soul in this group) It produces my report #
"VesselID""yy""JobType""Count"
Sample result: 06905SCI0005
What I Want:
The report# result for each record maintaining the count per Vessel/yy/JobType
ex.
JobNo ReportNo VslID YY JobType Count
1 00603SCI0001 006 03 SCI 0001
2 00605FSY0001 006 05 FSY 0001
3 00605SCI0001 006 05 SCI 0001
4 00605FSY0002 006 05 FSY 0002
I've looked at If/Then,Where,Having and just have missed something. Any
help or suggestion is very appreciated.
FerryMary
query so all records are reflected. Guidance,f rom MVP Jeff, was alternative
to storing a calculation, by using combobox at top of form. I like this,
since everything I read says not to store one. But since my query is based
on "Max" it returns wrong value for older records. Following is what I have
and what I want:
What I Have:
The following Query produces the ReportNo that I prefer, but only only on
max records. When I try to alter it to show all records I wind up with a
result of 1 in each case. (I think I need a running count, but just can't
get it)
SELECT Max(tblJob.JobNumber) As MaxOfJobNumber,
Format(tblJob.VesselID,"000") &
Format(tblJob.InitiatedDate,"yy") &
Format(tblStatus.JobType) &
Format(Count(tblStatus.Jobtpe),"0000") As ReportNo,tblJob.VesselID
FROM tblStatus INNER JOIN tblJob ON tblStatus.StatusED
GROUP BY tblJob.Vessel,(tblStatus.JobType),Format(tblJob.VesselID,"000") &
Format(tblJob.InitiateDate,"yy")
ORDER BY Max(tblJob.JobNumber) DESC;
That query is an alteration of query worked out for me by Chris2(another
generous soul in this group) It produces my report #
"VesselID""yy""JobType""Count"
Sample result: 06905SCI0005
What I Want:
The report# result for each record maintaining the count per Vessel/yy/JobType
ex.
JobNo ReportNo VslID YY JobType Count
1 00603SCI0001 006 03 SCI 0001
2 00605FSY0001 006 05 FSY 0001
3 00605SCI0001 006 05 SCI 0001
4 00605FSY0002 006 05 FSY 0002
I've looked at If/Then,Where,Having and just have missed something. Any
help or suggestion is very appreciated.
FerryMary