Det her skulle kunne gøre det for dig.
Du skal selv indsætte din connection string.
<%
Dim adoConn, rsCommon, strSQL
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.ConnectionString = ""
Set rsCommon = Server.CreateObject("ADODB.RecordSet")
strSQL = "" & _
"SELECT TOP t1.CPR, t2.Niveau, t1.UDatoTid, t2.GDatoTid, t1.Rek1, t2.Rek2 " & _
"FROM Tabel1 AS t1 INNER JOIN Tabel2 AS t2 ON t1.CPR = t2.CPR " & _
"WHERE (t2.GDatoTid < t1.UDatoTid) " & _
"ORDER BY t1.CPR, t2.Niveau, t1.UDatoTid, t2.GDatoTid;"
rsCommon.Open strSQL, adoConn
If NOT rsCommon.EOF Then
Response.Write("<table>")
Response.Write("<tr>")
Response.Write("<td>CPR</td>")
Response.Write("<td>UDatoTid</td>")
Response.Write("<td>GDatoTid</td>")
Response.Write("<td>Rek1</td>")
Response.Write("<td>Rek2</td>")
Response.Write("</tr>")
Do While NOT rsCommon.EOF
Response.Write("<tr>")
Response.Write("<td>" & rsCommon("CPR") & "</td>")
Response.Write("<td>" & rsCommon("UDatoTid") & "</td>")
Response.Write("<td>" & rsCommon("GDatoTid") & "</td>")
Response.Write("<td>" & rsCommon("Rek1") & "</td>")
Response.Write("<td>" & rsCommon("Rek2") & "</td>")
Response.Write("</tr>")
rsCommon.MoveNext
Loop
Response.Write("</table>")
End If
rsCommon.Close
Set rsCommon = Nothing
adoConn.Close
Set adoConn = Nothing
%>