Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP SQL Syntax - Tuesday BrainFreeze
Message
 
 
To
11/07/2007 11:39:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01238981
Message ID:
01239340
Views:
9
>Just a sample hit me, somehow related, from another forum:
>
>select alltrim(firstName)+' '+alltrim(lastName) as fullName from ...
>
>vs
>
>select firstName-(' '+lastName) as fullName from ...
>
>The latter ensures you'd have a consistent result even if the base structures change.
>Cetin

I've tried it and got 51 for both cases:
CREATE CURSOR Table1 (FirstName C(20), LastName C(30))
INSERT INTO Table1 VALUES ('Mike', 'Cole')
INSERT INTO Table1 VALUES ('Cetin', 'Basoz')
INSERT INTO Table1 VALUES ('Tracy', 'Holzer')
INSERT INTO Table1 VALUES ('Borislav', 'Borissov')

select alltrim(firstName)+' '+alltrim(lastName) as fullName ;
from table1 INTO CURSOR curTest
=MESSAGEBOX(FSIZE('fullName'))

select firstName-(' '+lastName) as fullName ;
from table1 INTO CURSOR curTest
=MESSAGEBOX(FSIZE('fullName'))
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform