I trying to set up a web site using ASP to run queries from a linked SQL datasource. I can get all of them to run right but I would like to have one query run only if the user# matches the password. I have a user# and password field in one of the tables but I can not figure out the syntax to get it to run only if they match.
The rest of query works fine, this is the end where I select the fields user# and password. The query works if I remove the last part and use just the W-number but not when I AND them together. I know this is a simple approach but the information is not critical is just a little sensitive for some employees.
Thanks for the help,
******this is the total statement***********
The rest of query works fine, this is the end where I select the fields user# and password. The query works if I remove the last part and use just the W-number but not when I AND them together. I know this is a simple approach but the information is not critical is just a little sensitive for some employees.
Thanks for the help,
Code:
WHERE (tblEmployees.[W-Number]=%%wnumber%%
AND tblEmployees.[Password]=%%pass%%);
******this is the total statement***********
Code:
SELECT tblEmployees.[W-Number],
[tblRollcall/Evaluation].SessionID,
[tblScheduled Sessions].Date,
tblSubjects.Subject,
tblCourses.CourseName,
tblEmployees.[Password]
FROM tblSubjects
INNER JOIN (tblCourses
INNER JOIN (tblEmployees
INNER JOIN ([tblScheduled Sessions]
INNER JOIN [tblRollcall/Evaluation]
ON [tblScheduled Sessions].SessionID = [tblRollcall/Evaluation].SessionID)
ON tblEmployees.[W-Number] = [tblRollcall/Evaluation].[W-Number])
ON tblCourses.CourseID = [tblScheduled Sessions].CourseID)
ON tblSubjects.SubjectID = tblCourses.SubjectID
WHERE (tblEmployees.[W-Number]=%%wnumber%%
AND tblEmployees.[Password]=%%pass%%);