cancel
Showing results for 
Search instead for 
Did you mean: 

Re: SQL for Gross profit Report by Customer between posting date parameters

Former Member
0 Kudos

Hi,

im new to SAP Forum, and have been provided with a task to provide the above referenced report.

The problem is that i am completely new to SAP and its 'T0. ' classification on headers in SQL.

So firstly, what does T0 stand for?

Secondly - would anyone have an idea about how i may go about producing a report which details the Gross Profit earned by Customer by Period?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

SELECT T0.CardCode, SUM(T1.GrssProfit) AS 'Gross Profit' FROM ORDR T0 JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocDate > [%0] AND T0.DocDate <[%1] GROUP BY T0.CardCode

Former Member
0 Kudos

Hi,

Welcome you post on the forum.

For your question, T0 is only a naming convention for alias to give to all tables. T obviously an abbreviation of Table. 0 is the first alias.

You may google Mastering SQL Queries for SAP Business One to find all available information you need.

Thanks,

Gordon

former_member196081
Active Contributor
0 Kudos

Hi,

We use T0,T1 etc for tables alias name.

Select t0.docnum from ordr t0

here t0 is the alias name for table "ORDR"

Check below link.

http://www.w3schools.com/sql/sql_alias.asp

Regards

Deepak tyagi