1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| bcp
"SELECT
T1.[Description] AS ""Description"",
T1.[No_] AS ""No Affaire"",
T1.[Responsibility Center] AS CA,
'1' AS Duree,
T1.[Ville],
T1.[Code Postal],
T1.[Bill-TO Customer No_],
T1.[Bill-TO Name] AS Nom_CltFct,
'' AS Type_CltFct,
'' AS CA_CltFct,
T1.[Bill-TO Name 2] AS Nom2_CltFct,
T1.[Bill-TO Address] AS Adresse_CltFct,
T1.[Bill-TO Address 2] AS Adresse2_CltFct,
'' AS Adress3_CltFct,
T1.[Bill-TO Post Code] AS CP_CltFct,
T1.[Bill-TO City] AS Ville_CltFct,
'' AS Tel_CltFct,
'' AS Fax_CltFct,
'' AS Siren_CltFct,
'' AS ""Montant Devis"",
convert(char(10),T1.[ORDER Date],103) AS Date_Commande,
T1.[Quote No_] AS ""No de Devis"",
T1.[Mission Type] AS ""Type mission"",
T1.[Study Type] AS ""Type étude"",
T1.[Ingineer Code] AS ""Code Ingénieur"",
T2.[Name] AS ""Name"",
case
when T1.[IS Internal ORDER] = '0' then 'Externe'--ok
when T1.[IS Internal ORDER] = '1' then 'Interne'--ok
end AS ""Interne/Externe""
FROM dbo.MaBASE$Project T1
LEFT OUTER JOIN dbo.MaBASE$Resource T2
ON T1.[Ingineer Code] = T2.No_
WHERE T1.[No_] <> ''
AND T1.[ORDER Date] = convert(varchar(10),getdate(),103)
AND T1.[Responsibility Center] <> 'LA'
"
queryout Y:\MAJ.txt -c -T |
Partager