๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.opensource
6 messages
6 total messages Started by Nando Tue, 15 Nov 2005 20:37
How to get a substring from a cast SELECT?
#192
Author: Nando
Date: Tue, 15 Nov 2005 20:37
8 lines
1121 bytes
Hi,

I'm trying to get a substring from a date field using SELECT CAST(DateField 
AS CHAR(12)) but I can't find the way for doing so.

Any help will be appreciated,

Nando. 
Re: How to get a substring from a cast SELECT?
#193
Author: Dan Palley
Date: Tue, 15 Nov 2005 21:15
14 lines
1393 bytes
"Nando" <nando@nowhere.com> wrote in message 
news:437a46cc$1@newsgroups.borland.com...
> Hi,
>
> I'm trying to get a substring from a date field using SELECT 
> CAST(DateField AS CHAR(12)) but I can't find the way for doing so.
>

Can you give us an example of what output you're trying to get?  I assume 
you're using IB 6 Open Edition.

Have you looked at the EXTRACT function?

Dan 
Re: How to get a substring from a cast SELECT?
#194
Author: Nando
Date: Tue, 15 Nov 2005 21:36
30 lines
1720 bytes
Thanks for your posting.

"Dan Palley" <dan@trams.com> escribi๏ฟฝ en el mensaje 
news:437a505f@newsgroups.borland.com...
> "Nando" <nando@nowhere.com> wrote in message 
> news:437a46cc$1@newsgroups.borland.com...
>> Hi,
>>
>> I'm trying to get a substring from a date field using SELECT 
>> CAST(DateField AS CHAR(12)) but I can't find the way for doing so.
>>
>
> Can you give us an example of what output you're trying to get?  I assume


What I'm trying to get are only the las two digits of the year from the 
DateField.

> you're using IB 6 Open Edition.

Yes, I'm using version 6.0.2.0

>
> Have you looked at the EXTRACT function?
>

Not yet, but I'm going to do it right now.

> Dan
> 
Re: How to get a substring from a cast SELECT?
#195
Author: Nando
Date: Tue, 15 Nov 2005 21:40
8 lines
1230 bytes
> Have you looked at the EXTRACT function?


By the way,

I'cant find the EXTRACT function. Where is it? How to use it?

Nando. 
Re: How to get a substring from a cast SELECT?
#196
Author: Dan Palley
Date: Tue, 15 Nov 2005 23:28
12 lines
1322 bytes
"Nando" <nando@nowhere.com> wrote in message 
news:437a55bc$1@newsgroups.borland.com...
>> Have you looked at the EXTRACT function?
>
>
> By the way,
>
> I'cant find the EXTRACT function. Where is it? How to use it?

    select extract(year from issuedate) from invoice

Dan 
Re: How to get a substring from a cast SELECT?
#197
Author: Nando
Date: Wed, 16 Nov 2005 11:15
5 lines
1210 bytes
Thank You,

Now it is working fine.

Nando. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads