on 02-08-2018 9:34 AM
Hi, I have a query that shows all the newly created customer accounts.
I'm using the OCRD table. I need to add the 'created by' user to the script if possible. I can't see any field that gives me the user that created the account in this table. Does anyone know how I could get the into my script? At the moment, this information is on the Tools-Show history screen. Thanks, Eoin.
My query:
SELECT T0.[CardCode], T0.[CardName], T0.[CmpPrivate],T0.[CreateDate], T1.Groupname, T0.[Phone1],T0.[CntctPrsn],T0.[E_Mail],T0.[StreetNo],T0.[Address], T0.[City], T0.[County], T0.[Country], T0.[ZipCode], T0.[QryGroup1] as 'Account Reviewed', T0.[MailStrNo], T0.[MailAddres], T0.[MailCity], T0.[MailCounty], T0.[MailCountr], T0.[MailZipCod] FROM OCRD T0 inner join ocrg T1 on t0.groupcode=t1.groupcode
created-by-field.pngWHERE T0.[CardType] ='C' and T0.[CreateDate] > '2018-01-20' AND T0.[QryGroup1]='N' ORDER BY T0.[CreateDate]
There is a creating user data in OCRD table in the field UserSign. If you join it to OUSR table, you can get the name of the user
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FROM OCRD T0 inner join ocrg T1 on t0.groupcode=t1.groupcode INNER JOIN OUSR T2 ON T0.UserSign = T2.USERID
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.