% DIM objRS2, last_ok_anmalning Set objRS2 = Server.CreateObject("ADODB.Recordset") last_ok = "SELECT max(anmalningstid) FROM fiskanmalningar where status = 'Ok';" objRS2.Open last_ok, objConn DO WHILE NOT objRS2.EOF last_ok_anmalning = objRS2("Max(anmalningstid)") objRS2.MoveNext Loop objRS2.Close Set objRS2 = Nothing 'objConn.Close 'Set objConn = Nothing ''''''''''''''''''''''''''''''''''''' DIM mySQL, str_Art, str_Date, str_Vikt, str_Klocka, str_sok1, str_sok2, str_sok3, str_urval, Date_Start, Date_Stop, mySQL2,strUrval2 str_urval = "status IS NULL" str_urval = "status is null or status ='Godkänd'" str_urval = "status is null or status ='Godkänd' or (status='Fotokrav' AND anmalningstid > '" & last_ok_anmalning & "')" str_urval = "(status is null or status ='Godkänd' or (status='Fotokrav' AND anmalningstid > '" & last_ok_anmalning & "')) and datum > '20110000'" str_urval = "(status is null or status ='Godkänd' or status='' or (status='Fotokrav' AND anmalningstid > '" & last_ok_anmalning & "')) and datum > '20110000'" IF DateDiff("d",FormatDateTime(Date()),"01/01/2011") > 0 then str_urval = "status is null or status ='Godkänd' or (status='Fotokrav' AND anmalningstid > '" & last_ok_anmalning & "') or (status='Test' AND anmalningstid > '" & "20100121173208" & "')" end if mySQL = "SELECT art,vikt,langd,omkr,datum,klocka,metod,bete,plats,ort,lag,namn,namntel,vagtyp,vittne,vittnetel,ovrigt,email,remoteaddr,anmalningstid,status FROM fiskanmalningar where " & str_urval & " ORDER BY anmalningstid DESC;" DIM objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open mySQL, objConn mySQL3 = "SELECT art, Count(art), Avg(vikt) FROM fiskanmalningar where " & str_urval & " GROUP BY art;" DIM objRS3 Set objRS3 = Server.CreateObject("ADODB.Recordset") objRS3.Open mySQL3, objConn %>
| Art | Vikt | Metod | Bete | Plats | Ort | Namn | Lag | Datum | |
| <% Response.Write objRS("art") %> | <% Response.Write objRS("vikt") %> | <% Response.Write objRS("metod") %> | <% Response.Write objRS("bete") %> | <% Response.Write objRS("plats") %> | <% Response.Write objRS("ort") %> | <% Response.Write objRS("namn") %> | <% Response.Write objRS("lag") %> | <% Response.Write strSwedDate %> | <% Response.Write objRS("status") %> |