Microsoft
Software
Hardware
Network
Question : Need a SQL query
2 tables: userfile & rcvfile
need a query to create a list of distinct users that are authorized to receive materials, how many times they have received materials and the last date they received materials
userfile
userid
authorized (list of authorized actions for userid separated by a tilde (~), RECEIVER means they can receive materials)
rcvfile
receiveperson (matches userid above)
receiptdate
I believe that is all you should need. I have thus far:
SELECT userid FROM userfile
WHERE authorized LIKE '%RECEIVER%'
Thanks in advance.
- Jim
Answer : Need a SQL query
SELECT u.userid, COUNT(r.rcvfile), MAX(r.receiptdate)
FROM userfile u
left join rcvfile r on r.receiveperson = u.userid
WHERE u.authorized LIKE '%RECEIVER%'
group by u.userid
>> SQL 2008 and intellisense.... expanded my "m" to "master"
Random Solutions
Good free network Management software
Can I copy a SQL agent job (2008) from one server to another?
PHP cannot connect to mySQL on LAMP server
Changing number of NSPI connections on Windows 2008 Global Catalogs
Dell PE 2850, ESXi 4.0, 64bit guest VMs?
Complete uninstall of Sharepoint Services 3.0 from Windows 2008 Server
Installing Exchange 2003 Enterprise, what switches do I need to use with dcdiag?
Unable to install any framework .NET in XP Mode (Virtual PC)
Safari beach ball when I open it
How to print logos on Epson T88IV