Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 6 of 6 total |
First Letter in word to Uppercase, rest to lower case |
Thu, Sep 24 2009 2:11 PM | Permanent Link |
adam | I am amalgamating 2 databases (currently Access) & putting them into a DBISAM system.
1 has names all entered UPPER CASE , the other Proper Case. I would prefer to standardize on Proper Case, and I hoped that DBISAM would have a function for this, but I don't see one. The names contain spaces, so I can't just capitalize the first letter i.e. LOWER(Name) then Name := UPPER(Extract(Name as Char(1)) + {code here to return the whole of the name except the first letter} ... although I will do this as a last resort. -- Would it be easier to use Delphi & write a quick & dirty app to work through the table batch-wise, looking for the first letter & CHAR's after SPACES? |
Thu, Sep 24 2009 4:54 PM | Permanent Link |
"Raul" | You can do it in SQL quite easily but it won't necessarily be "proper"
names. Quick and dirty select statement would be something like this (not tested but shoudl work and once you're happy with it change it to update actual column): select concat(ucase(left(NAME for 1)) , lcase(substring(NAME from 2))) from UPPER_TABLE (replace NAME with proper column name and UPPER_TABLE with actual table name) However, you would still have problems with the names that validly contain multiple upper-case letter (e.g. O'Malley, De Rossa, McCain, etc) Raul "adam" <adam@fullwellmill.co.uk> wrote in message news:2A2404CA-0709-45A9-B638-2CFA89E41143@news.elevatesoft.com... >I am amalgamating 2 databases (currently Access) & putting them into a >DBISAM system. > > 1 has names all entered UPPER CASE , the other Proper Case. > > I would prefer to standardize on Proper Case, and I hoped that DBISAM > would have a > function for this, but I don't see one. > > The names contain spaces, so I can't just capitalize the first letter > > i.e. LOWER(Name) then > > Name := UPPER(Extract(Name as Char(1)) + {code here to return the whole of > the name except > the first letter} > > .. although I will do this as a last resort. > > -- > > Would it be easier to use Delphi & write a quick & dirty app to work > through the table > batch-wise, looking for the first letter & CHAR's after SPACES? > |
Thu, Sep 24 2009 5:01 PM | Permanent Link |
"Raul" | Ignore the prev email - did not notice the issue regarding multiple names
and spaces before i sent it. SQL will get tricky with this so doing a quick delphi code and just looping thru table is likely easier. Raul "Raul" <raul@raul.ca> wrote in message news:44C63A84-8D9E-4003-B36A-5C42B6A219A1@news.elevatesoft.com... > You can do it in SQL quite easily but it won't necessarily be "proper" > names. > > Quick and dirty select statement would be something like this (not tested > but shoudl work and once you're happy with it change it to update actual > column): > > select concat(ucase(left(NAME for 1)) , lcase(substring(NAME from 2))) > from UPPER_TABLE > > (replace NAME with proper column name and UPPER_TABLE with actual table > name) > > However, you would still have problems with the names that validly contain > multiple upper-case letter (e.g. O'Malley, De Rossa, McCain, etc) > > Raul > > > > "adam" <adam@fullwellmill.co.uk> wrote in message > news:2A2404CA-0709-45A9-B638-2CFA89E41143@news.elevatesoft.com... >>I am amalgamating 2 databases (currently Access) & putting them into a >>DBISAM system. >> >> 1 has names all entered UPPER CASE , the other Proper Case. >> >> I would prefer to standardize on Proper Case, and I hoped that DBISAM >> would have a >> function for this, but I don't see one. >> >> The names contain spaces, so I can't just capitalize the first letter >> >> i.e. LOWER(Name) then >> >> Name := UPPER(Extract(Name as Char(1)) + {code here to return the whole >> of the name except >> the first letter} >> >> .. although I will do this as a last resort. >> >> -- >> >> Would it be easier to use Delphi & write a quick & dirty app to work >> through the table >> batch-wise, looking for the first letter & CHAR's after SPACES? >> > > |
Thu, Sep 24 2009 5:05 PM | Permanent Link |
"Raul" | Idea #2 then - how about doing the name changes in Access before converting?
Something like StrConv function should work. Raul "adam" <adam@fullwellmill.co.uk> wrote in message news:2A2404CA-0709-45A9-B638-2CFA89E41143@news.elevatesoft.com... >I am amalgamating 2 databases (currently Access) & putting them into a >DBISAM system. > > 1 has names all entered UPPER CASE , the other Proper Case. > > I would prefer to standardize on Proper Case, and I hoped that DBISAM > would have a > function for this, but I don't see one. > > The names contain spaces, so I can't just capitalize the first letter > > i.e. LOWER(Name) then > > Name := UPPER(Extract(Name as Char(1)) + {code here to return the whole of > the name except > the first letter} > > .. although I will do this as a last resort. > > -- > > Would it be easier to use Delphi & write a quick & dirty app to work > through the table > batch-wise, looking for the first letter & CHAR's after SPACES? > |
Fri, Sep 25 2009 5:18 AM | Permanent Link |
adam | Raul,
Thank you very much for all these suggestions, my SQL with Str Functions isn't great, so the code in your first post is useful & I might well use it in the future thank you. I don't do too much work in Access, but I will look at the Str Function you suggest ... that is really helpful! Adam |
Sat, Sep 26 2009 12:16 AM | Permanent Link |
"Raul" | Sample Access query similar to this should show if conversion is working: :
SELECT TBLNAMES.*, StrConv([Name],3) AS FixedName FROM TBLNAMES; (replace TBLNAMES with your table name and [Name] with your data column). Raul "adam" <adam@fullwellmill.co.uk> wrote in message news:1347683B-3BE7-4E59-98AE-CDBD0B448A6F@news.elevatesoft.com... > Raul, > > Thank you very much for all these suggestions, my SQL with Str Functions > isn't great, so > the code in your first post is useful & I might well use it in the future > thank you. > > I don't do too much work in Access, but I will look at the Str Function > you suggest ... > that is really helpful! > > Adam > |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |