looping, its alive... ALIVE!
Okay Kris,
This works, but it doesn't stop with the queryDay, it gets Monday thru Saturday.
I've made the changes I could to your suggestions. I just need it to show
one day at a time based on the QueryString.
...?queryDay=Monday&queryDate=06/02/2003
What do you think? Or what does anyone else think? I'm burnt.
********************************************************************
Set rstTimes = Server.CreateObject("ADODB.Recordset")
strSQL = "Select dat.AvailableTime, ad.AppTime From DaysAndTimes dat Left
Outer Join AppDetails ad on dat.AvailableTime = ad.AppTime" &_
" and dat.TODAY = '" & request.querystring("queryDay") & "'" &_
" and ad.AppDate = '" & request.querystring("queryDate") & "'"
rstTimes.Open strSQL, DBConn
If Not isEmpty(rstTimes("AppTime")) Then
TheMessage1 = "--TIME UNAVAILABLE--"
End If
End If
<%
do until rstTimes.EOF
%>
<TR><form method="post" id="form1" name="form1">
<% If (rstTimes("AppTime") = rstTimes("AvailableTime")) Then %>
<TD width="75" align="middle" height="30"><% Response.Write rstTimes("AvailableTime")
%></TD>
<TD width="450" height="30"><% Response.Write TheMessage1%>
<% Else %><TD width="75" align="middle" height="30"><% Response.Write rstTimes("AvailableTime")
%></TD>
<TD width="450" height="30"><INPUT id="Text1" type="text" name="Text1">
<IMG height="1" src="i/clear.gif" width="20">
<IMG height="1" src="i/clear.gif" width="15"> <INPUT id="Submit2" type="submit"
value="Submit" name="Submit2">
<IMG height="1" src="i/clear.gif" width="20">SELECT THIS TIME</TD>
<% End If %></TD>
</form></TR>
<%
rstTimes.MoveNext
loop
%>
********************************************************************
[1986 byte] By [
Kyle] at [2007-11-9 17:50:35]

# 1 Re: looping, its alive... ALIVE!
Did you try the query with the parentheses and where clause I suggested,
rather than using the same query you did last time? Here's that
suggested query again, in case you lost track of it:
Select dat.AvailableTime, ad.IsOkay
From (DaysAndTimes dat Left Outer Join AppDetails ad
on dat.AvailableTime = ad.AppTime)
where dat.Today = <day>
and ad.AppDate = <date>
Once again, if this doesn't work, try moving "and ad.AppDate = <date>"
inside the parentheses, like so:
Select dat.AvailableTime, ad.IsOkay
From (DaysAndTimes dat Left Outer Join AppDetails ad
on dat.AvailableTime = ad.AppTime
and ad.AppDate = <date>)
where dat.Today = <day>
"Kyle" <kfinch@bayoucitygroup.com> wrote in message
news:3ed76044$1@tnews.web.dev-archive.com...
>
> Okay Kris,
> This works, but it doesn't stop with the queryDay, it gets Monday thru
Saturday.
> I've made the changes I could to your suggestions. I just need it to
show
> one day at a time based on the QueryString.
> ..?queryDay=Monday&queryDate=06/02/2003
> What do you think? Or what does anyone else think? I'm burnt.
> ********************************************************************
> Set rstTimes = Server.CreateObject("ADODB.Recordset")
> strSQL = "Select dat.AvailableTime, ad.AppTime From DaysAndTimes dat
Left
> Outer Join AppDetails ad on dat.AvailableTime = ad.AppTime" &_
> " and dat.TODAY = '" & request.querystring("queryDay") & "'" &_
> " and ad.AppDate = '" & request.querystring("queryDate") & "'"
> rstTimes.Open strSQL, DBConn
> If Not isEmpty(rstTimes("AppTime")) Then
> TheMessage1 = "--TIME UNAVAILABLE--"
> End If
> End If
>
> <%
> do until rstTimes.EOF
> %>
> <TR><form method="post" id="form1" name="form1">
> <% If (rstTimes("AppTime") = rstTimes("AvailableTime")) Then %>
> <TD width="75" align="middle" height="30"><% Response.Write
rstTimes("AvailableTime")
> %></TD>
> <TD width="450" height="30"><% Response.Write TheMessage1%>
> <% Else %><TD width="75" align="middle" height="30"><% Response.Write
rstTimes("AvailableTime")
> %></TD>
> <TD width="450" height="30"><INPUT id="Text1" type="text"
name="Text1">
> <IMG height="1" src="i/clear.gif" width="20">
> <IMG height="1" src="i/clear.gif" width="15"> <INPUT id="Submit2"
type="submit"
> value="Submit" name="Submit2">
> <IMG height="1" src="i/clear.gif" width="20">SELECT THIS TIME</TD>
> <% End If %></TD>
> </form></TR>
> <%
> rstTimes.MoveNext
> loop
> %>
> ********************************************************************
>
>