get info from 2 tables with 2 condition

P

PeterL

Hello,
as you can see from preveous postings I want accompish:
1) from tblVetskebalans
http://www12.brinkster.com/vatskebalans/tblvetskebalans11.asp
for each PatID (= personnummer) = Request.Form("rapport")
get:(e.g)
date Fluidsname (=vätskor) Volym
2003-12-20 Glukos buffrad 1 23456
Albumin 40 mg/ml 1234
Blod 333
2003-12-22 Glukos 50 mg/ml + EL 403

and from tblPersonuppgifter get
PatID (= personnummer) = Request.Form("rapport")
ftEnamn
ftFnamn
I´ve tried this code:
Code:
 <%
Set vbalans = Server.CreateObject("ADODB.Connection")
vbalans.Provider = "Microsoft.Jet.OLEDB.4.0"
MdbFilePath = Server.MapPath("\vatskebalans\db\vbalans.mdb")
vbalans.ConnectionString = "Data Source='" & MdbFilePath & "'"
vbalans.open
strSQL = "SELECT tblFluids.FluidNamn, tblFluids.FluidID,
tblVetskebalans.Dag," & _
" tblVetskebalans.PatID AS patid, tblVetskebalans.FluidID,
tblVetskebalans.Energi," & _
" tblVetskebalans.Volym, tblPersonuppgifter.PatID AS ID,
tblPersonuppgifter.ftFnamn," &_
" tblPersonuppgifter.ftEnamn FROM tblVetskebalans, tblFluids,
tblPersonuppgifter WHERE" &_
" tblPersonuppgifter.PatID = "&Request.Form("rapport")&" AND
tblVetskebalans.PatID = tblVetskebalans.Dag ORDER by Dag ASC"
Set rs1 = vbalans.Execute (strSQL)
Response.Write "<BR><B>" & strSQL & "</B><P>"
'formatera till svensk personnummer
Function SvPnr(txt)
personnummer =Left(txt,6) & " - " & Right(txt,4)
SvPnr = personnummer
End Function
Response.Write SvPnr(rs1("ID")) & "<BR>"
Response.Write "<B>" & rs1("ftEnamn") & ", " & rs1("ftFnamn") &
"</B><P><P><P>"
%>
<TABLE border=1>
<TR>
<TD><B>Datum</B></TD>
<TD><B>Vätska</B></TD>
<TD><B>Volym</B></TD>
<TD><B>Energi</B></TD>
</TR>
<%
Do While Not rs1.EOF
Response.Write "<TR><TD>" & rs1("Dag") & "</TD>"
Response.Write "<TD>" & rs1("FluidNamn") & "</TD>"
Response.Write "<TD>" & rs1("Volym") & "</TD>"
Response.Write "<TD>" & rs1("Energi") & "</TD></TR>"
rs1.MoveNext
Loop
vbalans.Close
Set vbalans = Nothing
%>
butkeepgetting only errors:
error '80020009'

Please help me - I starting to lose my mind, and can´t sleep for
several nights now...
thx in advance
any help will be appriciated
/Peter
 
B

Bob Barrows

PeterL said:
Hello,
as you can see from preveous postings I want accompish:
I've already answered this in your first thread. Instead of starting a new
thread, please reply to my post in your original thread and tell me why my
answer did not solve your problem. Perhaps I can offer futher suggestions.
Starting new threads for the same problem is extremely counter-productive.

Bob Barrows
 
P

PeterL

Bob Barrows said:
I've already answered this in your first thread. Instead of starting a new
thread, please reply to my post in your original thread and tell me why my
answer did not solve your problem. Perhaps I can offer futher suggestions.
Starting new threads for the same problem is extremely counter-productive.

Bob Barrows

Sorry Bob, I´ll never do that again
 
P

PeterL

Bob Barrows said:
I've already answered this in your first thread. Instead of starting a new
thread, please reply to my post in your original thread and tell me why my
answer did not solve your problem. Perhaps I can offer futher suggestions.
Starting new threads for the same problem is extremely counter-productive.

Bob Barrows

Sorry Bob, I´ll never do that again
 

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

Similar Threads

add up for each date 3
error '800a040e' 2
Problem in Returning Recordset in ASP 1
Timeouts 5
Listing Fields - advice needed 7
ASP input and EXCEL 0
show value in text box 2
print friendly function with asp 1

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top