I am stumped I have a union query that I can't get to work on an asp page I need it to open both tables get a sum from the charge filed and the payment field then subtract the charge form the payments any help would save me a migran.
dim conn, rs, sql, intTelephone, intMobile
set rs = Server.CreateObject ("ADODB.Recordset")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=F:\Cs\Data\Data.mdb;" & _
"Jet OLEDB:System Database=F:\Cs\Data\Secured.mdw", _
"MyName", "123456"
sql = "SELECT Sum(Charge) AS Charge FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("cs_1")) Union Select Sum(Payment) AS Payment FROM [Payments] WHERE [Payments].[ClientID]=" &Trim(session("cs_1"))
rs.open sql, conn
dim conn, rs, sql, intTelephone, intMobile
set rs = Server.CreateObject ("ADODB.Recordset")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=F:\Cs\Data\Data.mdb;" & _
"Jet OLEDB:System Database=F:\Cs\Data\Secured.mdw", _
"MyName", "123456"
sql = "SELECT Sum(Charge) AS Charge FROM [Projects] WHERE [Projects].[ClientID]=" &Trim(session("cs_1")) Union Select Sum(Payment) AS Payment FROM [Payments] WHERE [Payments].[ClientID]=" &Trim(session("cs_1"))
rs.open sql, conn