Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run sql server stored procedure from VFP
Message
From
14/09/2017 04:48:03
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01654272
Message ID:
01654278
Views:
57
Hello Naomi

I try your suggestion removing the ft.ftstamp condition (the last one).
The problem is the same , on SSMS no problem, but from VFP file are create on Disk but without records.
EXECUTE [ExportToExcelData] 'maisritmo21',
'SELECT
ft.no[Entidade], ft.nome[Nome Utente],f.telefone [Contacto], ft.etotal [Valor 1], Rtrim(f.refmb1)+SPACE(1)+RTRIM(f.refmb2)+SPACE(1)+RTRIM(f.refmb3) [Ref. MB 1],
(CASE WHEN SUBSTRING(area,1,1 ) = ''C'' THEN ''C''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''H'' THEN ''H''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''G'' THEN ''G''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
WHEN SUBSTRING(area,1,1 ) = ''A'' THEN ''A''+ substring(CAST(ft.ftano AS VARCHAR),3,2)
ELSE '''' END) [Amostra]
FROM ft (nolock)
LEFT JOIN (SELECT no , tlmvl FROM cl ) c ON c.no = ft.no
CROSS JOIN ft2 f
WHERE  f.ft2stamp = ft.ftstamp' ,
'C:\lixo\IMP2.xls'
Best regards,
Luis
Previous
Reply
Map
View

Click here to load this message in the networking platform