Hello Eirikur
Thanks for your Reply, i will go to try understand them and try.
also i solve the problema like this:
SELECT top 1 c.fdata,
c.fno,
c.nome,
c.morada,
c.local,
c.codpost,
(
SELECT --fi.ftstamp,
--fi.fno,
fi.ref,
fi.qtt,
fi.etiliquido ,
(SELECT fii.desconto from fi fii
WHERE fii.ftstamp = 'jm12081366002,349698778 '
AND fii.ref = fi.ref AND fii.fistamp = fi.fistamp FOR XML PATH('Linediscount'),TYPE)
FROM FI
INNER JOIN ft ON fi.ftstamp = ft.ftstamp
WHERE fi.ftstamp = 'jm12081366002,349698778 '
FOR XML PATH('Line'),TYPE
)
--,
--(SELECT
--fi.ftstamp,
--fi.desconto
-- FROM FI
--INNER JOIN ft ON fi.ftstamp = ft.ftstamp
--WHERE fi.ftstamp = 'jm12081366002,349698778 '
--FOR XML PATH('LineDiscount'),ROOT('Line') ,TYPE
--)
FROM ft c
where c.ftstamp = 'jm12081366002,349698778 '
FOR XML PATH('Document'), ROOT('VFPDataSet'),TYPE;
Now, for finish the output, i need to place on the beginning these 2 lines:
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPDataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\PHC15\AddTableToSchema_Nest.xsd">
Note : that the end of my XML file must stay like this:
</VFPDataSet>
Can you help me, based on my query, how can do that.
Many thanks for your reply
Beste regards
Luis Santos