Repeating Rows...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Tbl1

SONumber | Customer | Description |…

Tbl2

SONumber | EMPID | TimeCode | Date | Hours

TimeCodes contain the following

DETL
DESN
PENG
MANF

I need to sum the hour data according to TimeCode. So I create a sum query
which ends up looking like this.

SONumber | TimeCode | Hours
5755 DETL 42.5
5755 DESN 35.5
5755 PENG 10
5755 NONEng 100 Not “DETL†Or Not “DESN†Or Not “PENGâ€

Then I create a query to display them all at once and it ends up looking
like this.

SONumber | DETLHours | DESNHours | PENGHours | NONEngHours
5755 42.5 35.5 10
100
5755 42.5 35.5 10
100
5755 42.5 35.5 10
100
5755 42.5 35.5 10
100

Problem 1 I can’t get the DISTINCT statement to have any affect on removing
the duplicate entries. Will one of the Unions work or a Join….

Then I would like to rejoin this data to Tbl1. And that would look like this.

SONumber | Customer | Description |… DETLHours | DESNHours | PENGHours |
5755 Jays Cast Fixture 42.5
35.5 10


NONEngHours
100
 
Show us your SQL view for the crosstab described as "Then I create a query
to display them all at once and it ends up looking like this".

I would expect something like:
TRANSFORM Sum([Hours]) as SumHrs
SELECT SONumber
FROM qtotSumQuery
GROUP BY SONumber
PIVOT TimeCode;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top