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
I am trying to load windows xp on a hp g71-340us laptop. The factory installed OS is windows 7 Home Premium. When the set-up disk is loading i get a Stop 0x0000007b BSOD.
Can I set up a domain workstation offline?
CSS problem
Can't open to a specified PDF page in IE 8
Form elements in Access 2000 in Windows 7 64 bit move and enlarge!
visual studio 2010 not automatically rebuild
How to update & append at the same time from another table a table in SQL Server
SQL in C# code .. Reading Output Parameters.
Cant move or purge mailbox