I'm having a bit of trouble getting the results I need on a query.
My tables are as follows:
SubInfo
{
UserID
UserName
Password
SubName
Contact_First_Name
Contact_Lasst_Name
Email
}
Email
{
Record
UserID
JobNumber
EmailNote
}
JobInfo
{
JobNumber
JobKey
JobName
Owner
Architect
}
Email tells me whether or not the UserID associated is to receive email.
If it's there, that UserID receives email, if not, he doesn't.
Below is the query I use to retrieve the SubInfo information where there is a record in Email:
SELECT SubInfo.UserID, SubInfo.SubName, SubInfo.Email, SubInfo.UserName, JobInfo.JobName
FROM SubInfo, Email, JobInfo
WHERE (Email.UserID = SubInfo.UserID) AND (Email.JobNumber =#JobNumber#) AND (JobInfo.JobNumber = #JobNumber#)
(Anything with #'s are ColdFusion Variables)
Notice that this query is specific to Email.Jobnumber
I use the output to populate a select box (labeled "Users currently receiving Email).
Now I need to populate the select box so that all the other users who are not receiving Email are output from the query, also specific to the Email.JobNumber.
I've tried some things but got some weird data back.
Can anyone help me out?
My tables are as follows:
SubInfo
{
UserID
UserName
Password
SubName
Contact_First_Name
Contact_Lasst_Name
}
{
Record
UserID
JobNumber
EmailNote
}
JobInfo
{
JobNumber
JobKey
JobName
Owner
Architect
}
Email tells me whether or not the UserID associated is to receive email.
If it's there, that UserID receives email, if not, he doesn't.
Below is the query I use to retrieve the SubInfo information where there is a record in Email:
SELECT SubInfo.UserID, SubInfo.SubName, SubInfo.Email, SubInfo.UserName, JobInfo.JobName
FROM SubInfo, Email, JobInfo
WHERE (Email.UserID = SubInfo.UserID) AND (Email.JobNumber =#JobNumber#) AND (JobInfo.JobNumber = #JobNumber#)
(Anything with #'s are ColdFusion Variables)
Notice that this query is specific to Email.Jobnumber
I use the output to populate a select box (labeled "Users currently receiving Email).
Now I need to populate the select box so that all the other users who are not receiving Email are output from the query, also specific to the Email.JobNumber.
I've tried some things but got some weird data back.
Can anyone help me out?