Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
Converting Integer to String for LookUp control |
Tue, Sep 2 2008 4:48 AM | Permanent Link |
Pat | Hi all,
I use the Woll2Woll dbLookupCombo contol - I like the Quicken stlye AutoComplete feature. The AutoComplete works fine on string indexes. This time I have an integer index field and the AutoComplete does not work as such. Question is: how would you go getting a string field from the integer field into a lookup table/SQL? I had thought using a query somehow like SELECT The-Integer, The-Integer-Converted-To-A-String FROM MyTable ORDER BY The-Integer-Converted-To-A-String and then base the TwwDBLookupCombo on the query and use The-Integer-Converted-To-A-String as the LookupField. Problem is I do not know how to get the field The-Ineger-Converted-To-A-String in the SLQ OR, is there a better way in doing this? Thanks. Regards, Pat |
Tue, Sep 2 2008 5:30 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Pat
Getting an integer field as a string is a piece of cake - just use CAST(field AS VARCHAR(x)) where x is the length of the field you want the integer to end up in. Unfortunately your problem is more likely to be with the fact that numbers as characters do not sort "correctly" ie if you have 1,2,3,10 it will sort 1,10,2,3 Your query would need to be SELECT The-Integer, CAST(The-Integer AS VARCHAR(10)) FROM MyTable ORDER BY The-Integer That would give you a correctly sorted result set but how the autocomplete feature would work I have no idea since I don't have the w2w controls Roy Lambert [Team Elevate] |
Tue, Sep 2 2008 8:59 AM | Permanent Link |
Pat | Hi Roy,
>just use CAST(field AS VARCHAR(x)) where x is the length of the field you want the integer to end up in. that worked perfect Many thanks. Regards, Pat |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |