If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Showing records past 20 days ms SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-17-03, 14:06
AdultStarsMgn. AdultStarsMgn. is offline
Registered User
 
Join Date: Aug 2003
Location: Los Angeles, Ca
Posts: 2
Showing records past 20 days ms SQL

Pulling out my hair trying to get past date added to DB for listing
Plus trying to call image if date is within slotted number of days. I am tasked with this because of an unfinished project by someone else. ASP is a bit new to me. My code is below if anyone can suggest somethings.

set CatGirls = conntemp.execute("select thumb1, thumb2, thumb3, thumb4, thumb5, thumb6, thumb7, thumb8 from Categories where id = " & Category)

set CatName = conntemp.execute("select cat_name from Categories where id = " & Category)

<%
For x=0 to 7
If (CatGirls(x)) Then
set GirlName = conntemp.execute("select name, ad_title, incall, outcall, travel from Girls where id=" & CatGirls(x))
%>

<%
If (GirlName(2)) Then
%><img src="../images/icons/in.gif" alt="" width="11" height="30">
<%
End If

If (GirlName(3)) Then
%><img src="../images/icons/out.gif" alt="" width="11" height="30"><br>
<%
End If

If (GirlName(4)) Then
%><img src="../images/travel.gif" alt="" width="20" height="20">
<%
End If
%>

<strong><font color="#FF0000" size="3">Here is where I want the the set made for new records within 20 days pulling from</font></strong>

<%
Top8String = Top8String & "," & CatGirls(x)
End If
Next
set RestOfGirls = conntemp.execute("select id, name, ad_title, incall, outcall, travel from Girls where active=1 AND id IN (select girl_id from CategoryGirl where cat_id = " & Category & ") order by id")

Do While Not RestOfGirls.eof
If (InStr(Top8String, RestOfGirls(0)) = 0) Then
%>
<%
If (RestOfGirls(3)) Then
%><img src="../images/icons/in.gif" alt="" width="11" height="30">
<%
End If
If (RestOfGirls(4)) Then
%><img src="../images/icons/out.gif" alt="" width="11" height="30"><br>
<%
End If
If (RestOfGirls(5)) Then
%><img src="../images/travel.gif" alt="" width="20" height="20">
<%
End If
%>

<%

End If

RestOfGirls.MoveNext
Loop

Set CatGirls = nothing
Set RestOfGirls = nothing

%>
</tr>
</table>
</body>
</html>

<%

Set CatGirls = Nothing
Set CatName = Nothing
CloseConnection

%>
Reply With Quote
  #2 (permalink)  
Old 08-18-03, 10:04
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
What is acutally wrong with your code?

What errors?
Quote:
Pulling out my hair trying to get past date added to DB for listing
Adding it to the DB should be easy.

Do you mean displaying it in the output?

You need to know the column name where the "past date" is stored.
Reply With Quote
  #3 (permalink)  
Old 08-19-03, 21:14
unatratnag unatratnag is offline
Registered User
 
Join Date: Jul 2003
Location: Ohio/Chicago
Posts: 75
can you actually just give us the DB schema and what you want to do? Who designed this code? This code is just all over the place, what the hell is Top8String used for? it's declared and set and never used, there's random table closings at the end,
Quote:
Here is where I want the the set made for new records within 20 days pulling from
what's a set for new records? a table with a max of 20 records displayed?
Quote:
Plus trying to call image if date is within slotted number of days
what's calling an image? displaying an image? What's Past Date? RHS98 understands but i don't, is that the day this script is run? The day the image was inserted into the DB? A column in the db?

hopefully we can find a better way to do this....

there's just too much going on and with not knowing anything about what you're doing and what you actually WANT to do. So can you just say this is the database and it's set up, my boss wants me to do this and this and display that.

I'm not making fun of you, i understand you're new, just don't be afraid to talk in english and not code since you don't understand asp very well, that's how programs get done is the users telling you their specifications without knowing anything about the code.
Reply With Quote
  #4 (permalink)  
Old 08-21-03, 04:35
AdultStarsMgn. AdultStarsMgn. is offline
Registered User
 
Join Date: Aug 2003
Location: Los Angeles, Ca
Posts: 2
Well, to make it easy, maybe if whoever wants to talk about this in a quicker and easier way, maybe IM on icq or yahoo would work. My # is 14634570 or yahoo beachcrow2000. If we do it this way, I can explain it. The code does look confusing but once it is seen in action and what it does, you might understand a bit more.

Joey
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On