Link to home
Start Free TrialLog in
Avatar of pstre
pstre

asked on

GP 2010 - Sales Transactions -Reports

I am trying to build a report for an end user and do not know where to pull the fields from.
The physicians name is in the physician field in the "user defined" field.  The case name is in the "notes" field.  I need some help in determining where these fields are in SQL.

Please see attached screenshoot
GP2010-Case.pdf
Avatar of Victoria Yudin
Victoria Yudin
Flag of United States of America image

For the physicians name, do you mean it's on the window that opens when you click User-Defined on the Sales Transaction Entry window? If so, those will all be in the SOP10106 table (for both posted and unposted transactions). Which field to use will depend on which one you have renamed to be "physician".

For the notes - these are stored in the SY03900 table. You can link to it from the SOP10100 table for unposted transactions (or SOP30200 table for posted transactions) on the NOTEINDX. So for example:

select s.SOPNUMBE, s.SOPTYPE, n.TXTFIELD 
from SOP10100 s
left outer join SY03900 n
on s.NOTEINDX = n.NOTEINDX

Open in new window

Avatar of pstre
pstre

ASKER

Great...thanks..  How would I link in the SOP10106 table in the above query?  Also, what SOp table would I use to run a report for billings - this means any invoice whether paid or not.

Thanks!
SOP10106 can be linked to other SOP tables by SOPTYPE and SOPNUMBE. So, for example:

select s.SOPTYPE, s.SOPNUMBE, u.*
from SOP10100 s
left outer join SOP10106 u
on s.SOPTYPE = u.SOPTYPE and s.SOPNUMBE = u.SOPNUMBE

Open in new window


When you say 'report for billings', that could mean so many different things, it's hard to suggest tables without more detail. What columns (or logic) are you looking for on this report?
Avatar of pstre

ASKER

Thanks... Can a 3rd table (SY03900) be linked. this table has the noteindex that we need to pull data from.

Report for billings = All invoices (posted and unposted)
ASKER CERTIFIED SOLUTION
Avatar of Victoria Yudin
Victoria Yudin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pstre

ASKER

Victoria is so knowledgable on GP and the tables AND SQL..  Much appreciated