Make Table query

ashwinghanta

Board Regular
Joined
Dec 6, 2011
Messages
118
Hello Everyone,

I have the following table and I want to create a table out of this
SYSTEMEREIGNISDATUM_ZEITANTRAGSNUMMER
WLAUS_ED1.1.2016123
WLAUS_ES1.2.2016123
ZWEIN_ED1.3.2016123
ZWEIN_ES1.4.2016123
WLAUS_ED1.5.2016222
WLAUS_ES1.6.2016222

<tbody>
</tbody>

I want to use the maketable query which gives me a table like this

ANTRAGSNUMMERAusgangDatenstromWebLifeAusgangesigniertWebLifeEingangeDatenstromzworkflowAusgangesigniertzworkflow
1231.1.20161.2.20161.3.20161.4.2016
2221.5.20161.6.2016

<tbody>
</tbody>


I have tried with the following make table SQL Query

Code:
SELECT  VWDRSSTA.ANTRAGSNUMMER AS Antragsnummer, VWDRSSTA.DATUM_ZEIT AS AusgangDatenstromWebLife, VWDRSSTA.DATUM_ZEIT AS AusgangesigniertWebLife, VWDRSSTA.DATUM_ZEIT AS EingangeDatenstromzworkflow, VWDRSSTA.DATUM_ZEIT AS Ausgangesigniertzworkflow FROM VWDRSSTA WHERE (VWDRSSTA.SYSTEM ='WL' AND VWDRSSTA.EREIGNIS='AUS_ED') OR (VWDRSSTA.SYSTEM ='WL' AND VWDRSSTA.EREIGNIS='AUS_ES')  OR (VWDRSSTA.SYSTEM ='ZW' AND VWDRSSTA.EREIGNIS='EIN_ED')  OR (VWDRSSTA.SYSTEM ='ZW' AND VWDRSSTA.EREIGNIS='EIN_ES')

which gives me something like this

ANTRAGSNUMMERAusgangDatenstromWebLifeAusgangesigniertWebLifeEingangeDatenstromzworkflowAusgangesigniertzworkflow
1231.1.20161.1.20161.1.20161.1.2016
2221.2.20161.2.20161.2.2016

<tbody>
</tbody>

Can someone tell me where am I going wrong in the code? Looking forward to hear from you
 
Hi,
I would recommend you build your cross tab queries in the query builder to get the right syntax. Probably you need something else in the group by clause since you are adding a new field to the query.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi,

I tried doing that using Group by

Code:
[COLOR=#333333]TRANSFORM Max(VWDRSSTA.DATUM_ZEIT) AS MaxOfDATUM_ZEIT[/COLOR]
[COLOR=#333333]SELECT VWDRSSTA.ANTRAGSNUMMER, VWDRSSTA.DOK_ART AS DOK[/COLOR]
[COLOR=#333333]FROM VWDRSSTA INNER JOIN V_NAMES [/COLOR]
[COLOR=#333333]ON (VWDRSSTA.SYSTEM = V_NAMES.SYSTEM_CODE) [/COLOR]
[COLOR=#333333]AND (VWDRSSTA.EREIGNIS = V_NAMES.EREIGNIS)[/COLOR]
[COLOR=#333333]WHERE VWDRSSTA.EREIGNIS = "EIN-ES"[/COLOR]
[COLOR=#333333]GROUP BY VWDRSSTA.ANTRAGSNUMMER,VWDRSSTA.DOK_ART[/COLOR]
[COLOR=#333333]ORDER BY VWDRSSTA.ANTRAGSNUMMER[/COLOR]
[COLOR=#333333]PIVOT V_NAMES.MAPPED_NAME;[/COLOR]

This code runs but It gives me the output of only
Code:
[COLOR=#333333][FONT=&quot][I]ZW | EIN_ES | Ausgangesigniertzworkflow |[/I][/FONT][/COLOR]
It does not show in other fields for that particular Antragsnummer. How should I regroup it so that I can also have the other fields?
 
Upvote 0
Did you build your query in the query builder or just edit this by hand?
 
Upvote 0

Forum statistics

Threads
1,215,334
Messages
6,124,319
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top