SQl query based on session variable

K

kwilsokl

I have an access database and it also is used for some asp pages.
There is a login page that was auto generated that create a session
variable based on the login, again all set auto generated by the
program.

I want to create a reports page for users but have it pass their user
id in the SQL query as a parameter and display records or queries
where it matches their userid.

But I don't know what I am doing. I used a simple ASP program to
create the asp pages which also created the login pages which
references a login table in the access database.


How do capture the login session and base the query on the logged in
user.
below is an example of my SQL query that has the user hard coded in
it.

SELECT tblParolee.ParoleeID, tblParolee.LastName,
tblParolee.FirstName, tblParolee.CareCoordinators,
tblCaseNotes.ContactDate
FROM tblParolee LEFT JOIN tblCaseNotes ON tblParolee.ParoleeID =
tblCaseNotes.ParoleeID
GROUP BY tblParolee.ParoleeID, tblParolee.LastName,
tblParolee.FirstName, tblParolee.CareCoordinators,
tblCaseNotes.ContactDate, Month([ContactDate])
HAVING (((tblParolee.CareCoordinators)="Craig Judd-ICS") AND
((Month([ContactDate]))=Month(Now())));



Inappropriate post?
If so, Red Flag it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top