Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFQuery Question - Where

Status
Not open for further replies.

susanh

MIS
Jan 16, 2001
229
US
I have a question on my cfquery and I don't know how to do this.

My cfquery if very simple...

SELECT *
FROM Tasks
WHERE Assigned = '#Username#'

Which then outputs my task data for just those tasks with the specific username that is logged in.

What I would like to do is tweek the query so that a select few usernames would be able to see all the task data..not just their own. Like a manager role.

Is there way I can just tweek my query to have that data display? If so how do I do it? I am losted...Can I wrap a <cfif> tag around my where condition?

Sue
 
You sure could put a cfif around the where clause and it sounds like you're on the right track.
 
SELECT *
FROM Tasks
<cfif userIsManager>
WHERE Assigned = '#Username#'
</cfif>

userIsManager is made-up. Use whatever way you have of telling. So yeah, you're cfif idea is one way to do it. give it a try. Let us knwo if you need more.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top