Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple sql query not working /vfpoledb
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01158200
Message ID:
01158266
Views:
28
I tried it and it worked. Thanks. I guess old fashioned SQL is not enuf.

>Try:
>
>SqlDataSource2.SelectCommand = "SELECT office, MAX(nsn) AS Nsn FROM csulog6 where nsn like" + "'51%' GROUP BY Office order by office"
>
>
>
>
>
>>SqlDataSource2.SelectCommand = "SELECT distinct office FROM csulog6 where nsn like" + "'51%' order by office" <-- GIVES the error
>>
>>SqlDataSource2.SelectCommand = "SELECT distinct office,nsn FROM csulog6 where nsn like" + "'51%' order by office" <--GIVES no error but I do not get get the OFFICE uniquely. :-(
>>
>>
>>
>>>
>>>>No, that was a typo just when I wrote in the UT, error still exists.
>>>>
>>>>>You have wrong table name, 'thistable' instead of 'csulog6'.
>>>>>
>>>>>>In my VB asp page I have this line
>>>>>>"SELECT distinct office FROM thistable where nsn like" + "'51%' order by office"
>>>>>>
>>>>>>and I get this error
>>>>>>
>>>>>>A field or property with the name 'nsn' was not found on the selected data source.
>>>>>>However "SELECT distinct office,nsn FROM csulog6 where nsn like" + "'51%' order by office" does work
>>>>>>
>>>>>>PS, I am using VFPOLEDB to access a microsoft visual Foxpro table
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform