Viewing 12 posts - 1 through 13 (of 13 total)
You know, I've always known of CASE, but I've never found a way to implement it.
This works perfectly! Thank you Luis Cazares!
March 21, 2014 at 7:05 pm
Lynn Pettis (6/7/2013)
tmac25 (6/7/2013)
Is there a way to have T-SQL select this record if I'm...
June 7, 2013 at 3:55 pm
Hello Chris!
ID in skills tables are the foreign keys (I don't really have control over how this was designed) Users_Hierarchy works like this with the other tables:
dbo.users_hierarchy.EMPLOYEEID = new_skills.id
dbo.users_hierarchy.OLDID =...
May 3, 2013 at 11:47 am
Hey Chris (or anyone!),
Looks like I am have jumped the gun on my previous statement, as I'm having a bit of trouble with my new modified queries weeding out duplicate...
March 29, 2013 at 5:04 am
ChrisM@Work (3/26/2013)
March 26, 2013 at 12:13 pm
Hello Chris!
I apologize, I attempted to point this out in the original post, I see where I could have been more clear.
The software that is being utilized all has ACTIONDATES/ACTIONORDER...
March 26, 2013 at 4:12 am
This is really odd, Chris. When I run that code, it runs quick and easy enough, however for some reason, it is duplicating ACTIONORDERS*
*NOTE - I changed ACTIONDATE to ACTIONORDER...
March 26, 2013 at 3:23 am
ChrisM@Work (3/26/2013)
;WITH Employees AS (SELECT TOP 1
employeeid,
FIRSTNAME,
LASTNAME,
EMAILADDRESS,
STARTDATE
FROM linkedServer.linkedDB.dbo.AUEMPLOYEE
WHERE employee.ENDDATE IS NULL -- still active
ORDER BY ACTIONDATE DESC -- most recent
)
SELECT
e.*,
org.ORGANIZATIONID,
job.JOBTITLEID
FROM Employees...
March 26, 2013 at 2:58 am
Hey,
Thanks for the reply.
I'm receiving the follow error:
Msg 8120, Level 16, State 1, Line 3
Column 'linkedServer.linkedDB.dbo.AUEMPLOYEE.ACTIONDATE' is invalid in the select list because it is not contained in either an...
March 26, 2013 at 2:40 am
foxxo (3/25/2013)
SELECT employee.EMPLOYEEID, employee.FIRSTNAME, employee.LASTNAME, employee.STARTDATE, employee.EMAILADDRESS, org.ORGANIZATIONID, job.JOBTITLEID
FROM dbo.AUEMPLOYEEJOBTITLE as job
CROSS APPLY
(SELECT TOP 1 emp.employeeid, emp.FIRSTNAME, emp.LASTNAME, emp.STARTDATE, emp.EMAILADDRESS, emp.ENDDATE
...
March 26, 2013 at 2:18 am
Viewing 12 posts - 1 through 13 (of 13 total)