Solved

STRCONV in Access queries

Posted on 1998-08-01
8
1,187 Views
Last Modified: 2008-02-26
How do I use the strconv function to modify the output field of a query so that the first letter is capitalised?
Where do I put the expression?
Thanks
Paul
0
Comment
Question by:pharries
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 8

Expert Comment

by:Helicopter
ID: 1957828
Put it in the query itself like:

SELECT StrConv([txtTest],3) AS capitalised
FROM Table1;
 The 3 is the bit that determines the output type
0
 

Author Comment

by:pharries
ID: 1957829
I could not get this to work.
I kept on getting the message "Syntax error"
So as to be sure The name of the table the data is in is "Windex"
The name of the field is "Word"
Thanks
0
 
LVL 3

Accepted Solution

by:
SPECIALIST earned 50 total points
ID: 1957830

To use this create a field in your query. in this example it is named newfield, the name of the field is word.

Newfield: strconv([word],3)  You can bring the field directly into your query and create a new field that has the captilized letters.

Note, you may or may not need to reference your table name, which would be like

Newfield: strconv([tablename].[word],3)

David

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Helicopter
ID: 1957831
pharries:

SELECT StrConv([word],3) AS capitalised
FROM Windex;

it's exactly the same. Go into query design and select SQL from the menu and just paste it in. Specialist's answer is the same, except he has given the QBE grid version


0
 

Author Comment

by:pharries
ID: 1957832
I had not realised it was an SQL command helicopter!
i tried Specialists answr first and it worked first time.
Thank you both
Paul
0
 
LVL 8

Expert Comment

by:Helicopter
ID: 1957833
Paul,
you may have tried his answer first, but I posted mine first. If you look at the SQL you will see that my answer was correct.

I realise you may not have known it was SQL (though SELECT..... etc. indicates that) but I think you should have asked for clarification rather than just reject.


0
 

Author Comment

by:pharries
ID: 1957834
Dear Helicopter,
I am new here, I did not know how to clarify without accepting.
I am sorry if you took offence.
I am very new to SQL and the penny did not drop
As this formed part of a complex query (for me) I had no idea where to insert the SQL statement in relation to others.
Thanks again
Paul
0
 
LVL 3

Expert Comment

by:SPECIALIST
ID: 1957835
Helicopter,

I realize your answer was correct also, but part of the reason people in this forum are asking questions from us, they are not as technical and most do not even know what SQL is.  I believe it is important to show someone the easiest possible way to accomplish the task, they will learn better ways later.

I try to put myself in the customers shoes, If they do not know what STRCONVERSION IS, How do they know what SQL is?  It was not that long ago I would have been asking the same questions.

This is not an attempt to belittle you.  I have analyzed your  answers to a number of questions and quite admire some of your responses.  Just an FYI.

David
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question