Home All Groups Group Topic Archive Search About
Author
30 Mar 2005 8:35 AM
patang
I am displaying the records from a table in a grid. The simpel SELECT
statement works fine. However, I have to use this select statement

select right("00000" + Column1,2), column2, column3 FROM mytable

This does not work. I mean it is not showing the 0000's in the first column.
The above statement is fine if I run it in SQL Server but how do I put the
above statement as a SELECT statement of oledbadapter ?

Author
30 Mar 2005 11:59 AM
Herfried K. Wagner [MVP]
"patang" <pat***@discussions.microsoft.com> schrieb:
>I am displaying the records from a table in a grid. The simpel SELECT
> statement works fine. However, I have to use this select statement
>
> select right("00000" + Column1,2), column2, column3 FROM mytable
>
> This does not work. I mean it is not showing the 0000's in the first
> column.
> The above statement is fine if I run it in SQL Server but how do I put the
> above statement as a SELECT statement of oledbadapter ?

Your question is not related to the VB.NET programming language.  Notice
that there is a separate group for .NET+database questions available:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
30 Mar 2005 4:45 PM
Paul Clement
On Wed, 30 Mar 2005 00:35:02 -0800, patang <pat***@discussions.microsoft.com> wrote:

¤ I am displaying the records from a table in a grid. The simpel SELECT
¤ statement works fine. However, I have to use this select statement
¤
¤ select right("00000" + Column1,2), column2, column3 FROM mytable
¤
¤ This does not work. I mean it is not showing the 0000's in the first column.
¤  The above statement is fine if I run it in SQL Server but how do I put the
¤ above statement as a SELECT statement of oledbadapter ?

Not sure what you're expecting but the Right function returns the number of characters specified
starting from the right side (end) of the string. In your example it returns the two right-most
characters.


Paul
~~~~
Microsoft MVP (Visual Basic)