Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verifying two SQL commands
Message
 
To
20/02/2008 15:37:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01294455
Message ID:
01295097
Views:
15
Just a note that if you SET ANSI ON, SELECT * From MyTable WHERE MyField>'', will work just fine.
We have a lot of queries where I work that access both SQL Server and VFP data.

-mike


>So far, when having the need to get all records where a specific field is not empty, I was using something like this:
>
>
>SELECT * From MyTable WHERE LEN(ALLTRIM(MyField))>0
>
>
>But, I need to adjust that SQL so it would fit for either VFP or SQL Server. So, I thought about something like this:
>
>
>SELECT * From MyTable WHERE MyField>""
>
>
>or
>
>
>SELECT * From MyTable WHERE MyField>" "
>
>
>But, to my surprise, only the 2nd one works. The first one doesn't return any record. Isn't the first suppose to be the same as the second one?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform