Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sort list in DataCombo control
Message
De
10/07/2000 12:51:09
 
 
À
10/07/2000 10:00:14
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00387633
Message ID:
00390310
Vues:
9
Hi, thank you all for your generous help.
I actually wanted to take out those records having a NULL in the CustID.
So the following SQL statement should be correct:

"SELECT * FROM Customer WHERE CustID IS NOT NULL ORDER BY CustID"

Sorry for not being clear in my question. Once again thank you all
for your professional help.

>Your suggested query will produce all records where the CustID is NULL. He wants to filter out those CustID from the query. At least that's how I understand it, maybe he can clarify.
>
>The question I would have is how those customer ID's got to be NULL in the first place.
>
>>Well, His request is clear "How to filter out those CustID having blank data in the SELECT statement?"
>>he said "having blank".
>>
>>Correct.
>>
>>
>>>I think you meant IS NOT NULL.
>>>
>>>>"SELECT * FROM Customer WHERE CustID IS NULL ORDER BY CustID"
>>>>
>>>>
>>>>
>>>>>How to filter out those CustID having blank data in the SELECT statement?
>>>>>
>>>>> .Open "SELECT * FROM Customer ORDER BY CustID.....
>>>>>
>>>>>>Hi,
>>>>>>Try to include the sort in your SELECT statment like this :
>>>>>>
>>>>>>.Open "SELECT * FROM Customer ORDER BY CustID",cnn1,adOpenKeyset,adLockOptimistic
>>>>>>
>>>>>>Hope this help
>>>>>>Rgrds
>>>>>>
>>>>>>
>>>>>>>I tried to sort the Recordset but it doesn't display correctly.
>>>>>>>Anything when wrong with my codes as follows:
>>>>>>>
>>>>>>>Set rsCustLookup = New ADODB.Recordset
>>>>>>>With rsCustLookup
>>>>>>> .CursorLocation = adUseClient
>>>>>>> .Open "SELECT * FROM Customer",cnn1,adOpenKeyset,adLockOptimistic
>>>>>>> .Sort = CustID
>>>>>>> .Requery
>>>>>>>End With
>>>>>>>
>>>>>>>Set dcCustIDList.RowSource = rsCustLookup
>>>>>>>dcCustIDList.ListField = "CustID"
>>>>>>>dcCustIDList.Refresh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform