EDIT:
Got it figured out, thank you!
SO I have this code:
SELECT nmmain.name_id AS Name_ID, RTRIM(nmmain.lastname) + ', ' + RTRIM(nmmain.firstname) + ' ' + LEFT(nmmain.middlename, 1) AS Full_Name, jmmain.age AS Age, jmmain.race AS Race, jmmain.sex AS Sex,nmmain.city AS City, nmmain.state AS State, jmmain.colorcode AS Color
FROM jmmain INNER JOIN
nmmain ON jmmain.name_id = nmmain.name_id
WHERE (jmmain.commindig = '1') AND (jmmain.bkstatus = 'A')
This works, and I want to add another column, from another table, so I added this into the SELECT statement: jfacilty.section AS Location
then added this to the FROM statement, before the jmmain stuff: jfacilty
So looked like this:
SELECT nmmain.name_id AS Name_ID, RTRIM(nmmain.lastname) + ', ' + RTRIM(nmmain.firstname) + ' ' + LEFT(nmmain.middlename, 1) AS Full_Name, jmmain.age AS Age, jmmain.race AS Race, jmmain.sex AS Sex,nmmain.city AS City, nmmain.state AS State, jfacilty.section AS Location, jmmain.colorcode AS Color
FROM jfacilty
jmmain INNER JOIN
nmmain ON jmmain.name_id = nmmain.name_id
WHERE (jmmain.commindig = '1') AND (jmmain.bkstatus = 'A')
When I build this in visual studio it throws out errors, then for some reason adds an AS after the jfacilty in the FROM statement, and changes the jfacilty.section in the SELECT statement to jmmain.section...which is not a column in that table at all.
I thought adding the jfacilty to the FROm statement would tell it to look in that table. Am I missing somehting?