Data Function ASP & VBScript

Author Message
mmcnab

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 12/30/2008
  • Status: offline
Data Function ASP & VBScript Tuesday, December 30, 2008 10:14 AM (permalink)
0
I have a web page with a drop down menue that lets a customer review their jobs.  Here is that code:
 
<%
   Set RS = Server.CreateObject("ADODB.Recordset")
   StrQ = "select [job number], [job name], [customer code], salespersonemail, dateentered from [view jobs] where [Customer Code] in (select folder_id from [view contact] where username='" & session("username") & "' and password='" & session("password") & "')"
   RS.Open StrQ, Conn
   if NOT RS.EOF then
     do while NOT RS.EOF
  Response.Write "<option value='" & RS("Job Number") & "'>" & RS("Job Name") & "</option>" & vbCrLf
  RS.MoveNext
  loop
   end if
   RS.close
%>
 
The problem is this lists ALL jobs from day one.  I want to limit it to the last 90 days.  I have a MS SQL query that executes properly in Server  Management Studio:
 

select
[job number], dateentered from [view jobs] where dateentered > '9/30/08'
 
So, now I need to incororate that into my web page but whatever I do, it throws a 500 server error.  I know it's a simple solution, but I'm having a brain freeze.  Any help would be appreciated!
 
#1
    ebgreen

    • Total Posts : 8219
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    RE: Data Function ASP & VBScript Tuesday, December 30, 2008 7:15 PM (permalink)
    0
    How about this:

    StrQ = "select [job number], [job name], [customer code], salespersonemail, dateentered from [view jobs] where [Customer Code] AND dateentered > '" & strNinetyDaysAgo & "' in (select folder_id from [view contact] where username='" & session("username") & "' and password='" & session("password") & "')"

    You will have to build the strNinetyDaysAgo string dynamically of course.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9