June 23, 2003 at 2:15 pm
I don't want ALL active courses. Courses are stored by departments. I want all active courses in department 10 only. Department 10 also has inactive courses.
I don't know how to check with the profiler to make sure the correct SQL code is being passed to the SQL Server.
Sorry I'm just getting back to this but I've been out of town due to a death in the family.
June 23, 2003 at 2:30 pm
Since I've been away for awhile, I need a refresher. This is what I currently have [neither of which not work]:
In my "dir.asp" file:
<% Set r = CreateObject("ADODB.Recordset")
r.open "SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE (LEDef_ActiveInd = 1 AND LEDef_Cd LIKE '10%') "UID=aspen;PWD=aspen;DSN=Aspen"
In my "row.asp" file:
<% Set r = createobject ("ADODB.Recordset") %>
<% r.Open "SELECT LEDef_Cd, LEDef_Name, LEDef_Desc, LEDef_ActiveInd, FROM LEDef WHERE (LEDef_ActiveInd = 1 AND LEDef_Cd LIKE '10%' and LEDef_PK = " & Request.QueryString("id"), "UID=aspen;PWD=aspen;DSN=Aspen" %>
What is the correct way to code this.
Thanks...
June 23, 2003 at 2:32 pm
Wanda,
Sorry about the death in your family.
It not clear what exactly do you want out of your SQL.
If you did not understand dj_meier's post, here is another example:
List all the outbound flights AND all the outbound flights departing after 5 pm.
Does your query look similar? This is not in the correct form.- because the second part is a subset of the first part.
(Did I confuse you enough ?)
-Ram
June 23, 2003 at 2:42 pm
Yes that is what I want. In my world:
A list of all active courses in department 10 only.
There are 10 departments which have courses listed in the database. Each department has a unique identifer for their courses. Each department have active and inactive courses listed.
Thanks for your words of kindness...
June 24, 2003 at 3:26 am
Wanda,
Seems to me your code looks OK and matches your requirements. Maybe the problem is to do with data.
Try
SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE LEDef_ActiveInd = 1
Do you get all active records?
SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE LEDef_Cd LIKE '10%'
Do you get all records starting '10'?
SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE LTRIM(LEDef_Cd) LIKE '10%'
Do you get all records starting '10'?
SELECT DISTINCT LEFT(LEDef_Cd,1),ASCII(LEDef_Cd) FROM LEDef_PK
Do you get any funny results? Such as first char not 1 (ascii 49) etc.
This will help to see if the data is the problem.
Far away is close at hand in the images of elsewhere.
Anon.
June 24, 2003 at 8:29 am
Thank you. I'll give this a try...
Viewing 6 posts - 31 through 35 (of 35 total)
You must be logged in to reply to this topic. Login to reply