Hi, first let just state that I'm hanging on by my teeth so bear with me.
I am trying to convert or reright an Access db in asp.net using sqlserver
in my access code I create a qry and then create another qry that calls data from the first qry.
In asp.net I create a function that calls a dataset and binds it to a data grid. that works fine. so next I created an other function and in the sql string I included the name of the function that created the first qry. So it looks something like this with the ending parts left off for space.
public Function qryIndTotals() As System.Data.IDataReader
Dim queryString As String = "SELECT [tblSlots].[pkDate], " _
& " Count([tblSlots].[slot1trainer]) AS [CountOfTrainerSlot1], " _
& " Count([tblSlots].[slot2trainer]) AS [CountOfTrainerSlot2]," _
&" Count([tblSlots].[slot3trainer]) AS [CountOfTrainerSlot3]" _
& "FROM [tblSlots] GROUP BY [tblSlots].[pkdate]"
This one binds fine
Then I try
Function qryWeekSum() as system.data.idatareader
dim qryString as string = "SELECT [qryIndTotals].*, [qryIndTotals].[CountOfTrainerSlot1].[qryIndTotals].[CountOfTrainerSlot2]+[qryIndTotals].[CountOfTrainerSlot3] " _
& " AS Total FROM [qryIndTotals] "
(sorry for the messy formating)
anyway I get "invalid obj name"
Now I'm not nieve ;) it doesn't supprise me that it doesn't work but if someone could walk me through the correct way I would be very greatful
Thanks very much
Raif
[email protected]