24. April 2023 18:04
OBJECT Query 50000 Query Test
{
OBJECT-PROPERTIES
{
Date=24.04.23;
Time=16:30:41;
Modified=Yes;
Version List=;
}
PROPERTIES
{
}
ELEMENTS
{
{ 50000; ;DataItem; ;
DataItemTable=Table50000 }
{ 50001;1 ;Column ; ;
DataSource=No. }
{ 50002;1 ;Column ; ;
DataSource=Amount (FCY) }
{ 50003;1 ;Column ; ;
DataSource=Remaining Amount (FCY) }
{ 50004;1 ;Column ; ;
DataSource=Open }
{ 50005;1 ;Column ; ;
DataSource=Customer No. }
{ 50006;1 ;Column ; ;
DataSource=Insert Date }
{ 50007;1 ;Column ; ;
DataSource=Stamped by No. }
{ 50008;1 ;Column ; ;
DataSource=Reason Code }
{ 50009;1 ;DataItem; ;
DataItemTable=Table50001;
DataItemTableFilter=Entry Type=FILTER(<>Initial Entry);
DataItemLink=Header Entry No.=My_Table."Entry No." }
{ 50010;2 ;Column ; ;
DataSource=Entry No. }
{ 50011;2 ;Column ; ;
ColumnFilter=Entry_Type=FILTER(<>Initial Entry);
DataSource=Entry Type }
}
CODE
{
BEGIN
END.
}
}
SELECT TOP 1
T1.[No_]
,T2.[Entry No_]
FROM [Table50000] AS T1
LEFT JOIN [Table50001] AS T2
ON T2.[Header Entry No_] = T1.[Entry No_]
AND T2.[Entry Type] <> 1
WHERE T1.[Entry No_] = 123
SELECT TOP 1
T1.[No_]
,T2.[Entry No_]
FROM [Table50000] AS T1
LEFT JOIN [Table50001] AS T2
ON T2.[Header Entry No_] = T1.[Entry No_]
WHERE T1.[Entry No_] = 123
AND T2.[Entry Type] <> 1