Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > get info from 2 tables with 2 condition

Reply
Thread Tools

get info from 2 tables with 2 condition

 
 
PeterL
Guest
Posts: n/a
 
      05-02-2004
Hello,
as you can see from preveous postings I want accompish:
1) from tblVetskebalans
http://www12.brinkster.com/vatskebal...kebalans11.asp
for each PatID (= personnummer) = Request.Form("rapport")
gete.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
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      05-02-2004
PeterL wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
PeterL
Guest
Posts: n/a
 
      05-02-2004
"Bob Barrows" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> PeterL wrote:
> > 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


Sorry Bob, I´ll never do that again
 
Reply With Quote
 
PeterL
Guest
Posts: n/a
 
      05-02-2004
"Bob Barrows" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> PeterL wrote:
> > 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


Sorry Bob, I´ll never do that again
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with while condition OR condition Bill W. Ruby 13 05-09-2011 09:42 PM
How to get database metadata information (i.e. existing tables and columns in tables) Chris Brat Python 5 08-22-2006 05:25 PM
Condition outside loop or separate loop for different condition? - Java 12 06-15-2005 08:50 AM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Text after 2 tables actually appears between 2 tables ! Peter Bassett HTML 3 08-15-2003 06:46 PM



Advertisments