create view crosstab per sql-syntax



Hello,

i would like to create a crosstab view within vb.net 2005 per sql-syntax.
Can someone help me with the right syntax?

here is how i tried it (didn't work):

Dim mySQL As String

mySQL = "CREATE VIEW a_w_tmp_ReportVertrag_Kreuz AS " & _

"TRANSFORM Sum(a_w_tmp_reportVertrag_Gruppiert.ZahlGesamt) AS [Summe von
ZahlGesamt] " & _

"Select Case a_w_tmp_reportVertrag_Gruppiert.Gruppe2 " & _

"FROM(a_w_tmp_reportVertrag_Gruppiert) " & _

"GROUP BY a_w_tmp_reportVertrag_Gruppiert.Gruppe2 " & _

"PIVOT a_w_tmp_reportVertrag_Gruppiert.Gruppe1"

Dim myCmd As OleDbCommand

myCmd = New OleDbCommand(mySQL, Me.Connection, myTransaction)

Try

myCmd.ExecuteNonQuery()

Catch ex As Exception

MsgBox(ex.Message, MsgBoxStyle.Information, "Datenbank Update")

Return False

End Try

Thanks in advance

Karin



.



Relevant Pages

  • Re: create view crosstab per sql-syntax
    ... i would like to create a crosstab view within vb.net 2005 per sql-syntax. ... Dim mySQL As String ... Dim myCmd As OleDbCommand ...
    (microsoft.public.data.oledb)
  • Re: Insert into SQl table
    ... What syntax can I use to insert the value from these variables into the ... 'Dim MyConnection As ADODB.Connection ... 'Dim MySQL As String ... 'Set MyConnection = New ADODB.Connection ...
    (microsoft.public.excel.programming)