Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp to sqlserver codes conversion
Message
From
25/11/2016 11:37:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Vfp to sqlserver codes conversion
Environment versions
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01643953
Message ID:
01643953
Views:
56
Dear Experts,

How to conevert these vfp codes for sqlserver 2008 management studtio?
SELECT PADR(LEFT(codes,1),7) as codes,names,SUM(amount) as amount FROM table1 WHERE LEN(ALLTRIM(codes)) = 7 GROUP BY 1,2 

UNION ALL ;
SELECT PADR(LEFT(codes,2),7) as codes,names,SUM(amount) as amount FROM table1 WHERE LEN(ALLTRIM(codes)) = 7 GROUP BY 1,2 

UNION ALL ;
SELECT PADR(LEFT(codes,4),7) as codes,names,SUM(amount) as amount FROM table1 WHERE LEN(ALLTRIM(codes)) = 7 GROUP BY 1,2 

UNION ALL ;
SELECT * FROM table1 WHERE LEN(ALLTRIM(codes)) = 7 ORDER BY 1
Next
Reply
Map
View

Click here to load this message in the networking platform