(Msg. 1) Posted: Thu Apr 19, 2007 2:02 pm
Post subject: How to CLng in a SQL query. Archived from groups: microsoft>public>excel>querydao (more info?)
I have a good query however one of the output columns I want to convert from
text to a number. I think that the CLng is the correct option I just do not
understand how to get the output to be a changed by the CLng function.
(Msg. 2) Posted: Mon Apr 23, 2007 11:51 am
Post subject: Re: How to CLng in a SQL query. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Thu, 19 Apr 2007 14:02:02 -0700, Jayneedshelp
<Jayneedshelp.TakeThisOut@discussions.microsoft.com> wrote:
>I have a good query however one of the output columns I want to convert from
>text to a number. I think that the CLng is the correct option I just do not
>understand how to get the output to be a changed by the CLng function.
It looks like this with a Jet (Access) database
SELECT tblLink.ProductID, CLng([MyTextField]) AS ConvertedText
FROM tblLink;
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
(Msg. 3) Posted: Mon Apr 23, 2007 1:34 pm
Post subject: Re: How to CLng in a SQL query. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hello Dick I cannot get your suggestion to work.
I am using msquery to get data into Ecel from a Oracle database.
I an error ORA-00923 FROM keyword not found where expected.
Is the data in the ( ) renaming the outout field?
Any further help would be appreciated.
Jay
"Dick Kusleika" wrote:
> On Thu, 19 Apr 2007 14:02:02 -0700, Jayneedshelp
> <Jayneedshelp.TakeThisOut@discussions.microsoft.com> wrote:
>
> >I have a good query however one of the output columns I want to convert from
> >text to a number. I think that the CLng is the correct option I just do not
> >understand how to get the output to be a changed by the CLng function.
>
> It looks like this with a Jet (Access) database
>
> SELECT tblLink.ProductID, CLng([MyTextField]) AS ConvertedText
> FROM tblLink;
> --
> Dick Kusleika
> Microsoft MVP-Excel
> http://www.dailydoseofexcel.com >
(Msg. 4) Posted: Tue Apr 24, 2007 10:59 am
Post subject: Re: How to CLng in a SQL query. [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
On Mon, 23 Apr 2007 13:34:01 -0700, Jayneedshelp
<Jayneedshelp.TakeThisOut@discussions.microsoft.com> wrote:
>Hello Dick I cannot get your suggestion to work.
>I am using msquery to get data into Ecel from a Oracle database.
>
>I an error ORA-00923 FROM keyword not found where expected.
>
>Is the data in the ( ) renaming the outout field?
>
>>
>> It looks like this with a Jet (Access) database
>>
>> SELECT tblLink.ProductID, CLng([MyTextField]) AS ConvertedText
>> FROM tblLink;
Jay:
CLng is a function in Jet, put I don't think it exists in Oracle. I don't
know anything about Oracle, but you might want to try the TO_NUMBER function
as described here
SELECT TO_NUMBER('MyTextField') "ConvertedText" FROM MyTable
Where MyTextField is the field name you want to convert, MyTable is the name
of the table, and ConvertedText is the name you want the converted field to
be.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum