Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 25 of 25 total
Thread Inverval problem
Fri, Sep 4 2009 10:59 AMPermanent Link

Uli Becker
Tim ,

> Not with the INTERVAL keyword in front of it. Smiley

OK, but then

>  select * from kalender where
>  StartTime - interval DaysBefore DAY > CURRENT_DATE

should work as well? Actually that's what I tried first.
I guess this syntax is only valid with constants, isn't it?

Uli
Fri, Sep 4 2009 12:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< This proves not to be the case >>

Just make sure that you put single quotes around them.  It may work for
single integer values, but it won't work for HH:MM and it isn't standard.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Sep 4 2009 12:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< should work as well? Actually that's what I tried first. I guess this
syntax is only valid with constants, isn't it? >>

You're confusing INTERVAL constants with CASTing a value to an INTERVAL.
You can't CAST a value to an INTERVAL by just putting the keyword INTERVAL
in front of it.  Just think of it like a date or time, which require the
keywords 'DATE' or 'TIME' in front of the date or time that is enclosed in
single-quotes after the keyword.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Sep 4 2009 1:20 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>You're confusing INTERVAL constants with CASTing a value to an INTERVAL.
>You can't CAST a value to an INTERVAL by just putting the keyword INTERVAL
>in front of it. Just think of it like a date or time, which require the
>keywords 'DATE' or 'TIME' in front of the date or time that is enclosed in
>single-quotes after the keyword.

That's a very good point and I for one have been guilty of doing just that. Intuitively it seems correct.

Roy Lambert
Fri, Sep 4 2009 2:16 PMPermanent Link

Uli Becker
Tim,

> You're confusing INTERVAL constants with CASTing a value to an INTERVAL.
> You can't CAST a value to an INTERVAL by just putting the keyword INTERVAL
> in front of it.  Just think of it like a date or time, which require the
> keywords 'DATE' or 'TIME' in front of the date or time that is enclosed in
> single-quotes after the keyword.

Thank you for making that clear. The secret is disclosed. Smiley

Uli
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image