Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT command
Message
From
16/04/2000 13:30:43
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
16/04/2000 13:26:51
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00360123
Message ID:
00360142
Views:
9
One more hint - After being confused with double and single quotes when building these strings, I was thrilled to find out that [] could also delimit a string. Now I use [ and ] for the outside, and the quotes for stuff that actually passes to the server.

Example: [WHERE MyField = "01" ]

>Edgar,
>
>What happens when you use:
>
>l_cSQL = "SELECT * " + ;
>    "FROM Table " + ;
>    "WHERE MyField = " + ;
>    ALLT(ThisForm.MyProperty)
>
>
>If that doesn't do it, then you want to use the ANSI SQL-92 SUBSTRING(MyField FROM nFirsrPosition FOR nNumberOfCharacters) which would be:
>
>    ....
>    "WHERE SUBSTRING(MyField FROM 1 FOR " + ;
>    ALLT(STR(LEN(ALLT(MyField)))) + ;
>    " ) = " + ALLT(ThisForm.MyProperty
>
>
>By the way, building the string as above will not give "String too long" errors. I find it easier to read.
>
>
>>I have to SELECT from a SQL server table on a field of char. 7
>>I do my SELECT and say something like this:
>>
>>l_cSQL = "SELECT *"
>>l_cSQL = l_cSQL + " FROM Table"
>>l_cSQL = l_cSQL + " WHERE myfield LIKE '"+ALLT(ThisForm.myProperty) + "%'"
>>
>>and the value of myProperty is '01'
>>
>>Now the problem with this is it will retrieve '011' or '0122' or wherever is after that. I don't want that. I only want the value of '01'
>>What function can I use to do this? Or how can I say that in my SELECT?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform