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)
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!
|
|
|
|
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)
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.
|
|
|
|