Código:
un saludo Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DSN=*************;UID=*****;PWD=*****" Set Dades = Server.CreateObject("ADODB.RecordSet") Dades.Open "select distinct ANI,MES from HORARIS",Conn,1 do while not Dades.Eof %> <strong><font face="arial" size=2> <% if Dades("MES")=1 then %>ENERO<% txtMes="Enero" end if if Dades("MES")=2 then %>FEBRERO<% txtMes="Febrero" end if if Dades("MES")=3 then %>MARZO<% txtMes="Marzo" end if if Dades("MES")=4 then %>ABRIL<% txtMes="Abril" end if if Dades("MES")=5 then %>MAYO<% txtMes="Mayo" end if if Dades("MES")=6 then %>JUNIO<% txtMes="Junio" end if if Dades("MES")=7 then %>JULIO<% txtMes="Julio" end if if Dades("MES")=8 then %>AGOSTO<% txtMes="Agosto" end if if Dades("MES")=9 then %>SEPTIEMBRE<% txtMes="Septiembre" end if if Dades("MES")=10 then %>OCTUBRE<% txtMes="Octubre" end if if Dades("MES")=11 then %>NOVIEMBRE<% txtMes="Noviembre" end if if Dades("MES")=12 then %>DICIEMBRE<% txtMes="Diciembre" end if%> <%=" "+CStr(Dades("ANI")) %> </font></strong><br> <TABLE WIDTH=100%><TR><TD WIDTH=33%> <STRONG><font face="arial" size=2>Dia</font></STRONG></TD><TD WIDTH=33%><STRONG><font face="arial" size=2>Planta Noble</font></STRONG></TD><TD WIDTH=34%><STRONG><font face="arial" size=2>Golfes</font></STRONG></TD></TR> <% Set Dades2 = Server.CreateObject("ADODB.RecordSet") consulta ="select DIA,MES,ANI,INICINOBLE,FINOBLE,INICIGOLFES,FIGOLFES from HORARIS WHERE MES="+CStr(Dades("MES")) Dades2.Open consulta,Conn,1 do while not Dades2.Eof %> <TR><TD><font face="arial" size=2> <%=CStr(Dades2("DIA"))+" "+txtMes%> </font></TD><TD><font face="arial" size=2> de <%=Dades2("INICINOBLE")%>h a <%=Dades2("FINOBLE")%>h </font></TD><TD><font face="arial" size=2> de <%=Dades2("INICIGOLFES")%>h a <%=Dades2("FIGOLFES")%>h </font></TD></TR> <%Dades2.MoveNext loop %></TABLE><BR><% Dades.MoveNext loop %>