Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
current_date()-inteval cast(mydays as varchar) day ? |
Tue, Apr 30 2019 3:54 AM | Permanent Link |
Yusuf Zorlu MicrotronX - Speditionssoftware vom Profi | Is it possible to have something like this in sql:
select current_date()-interval cast(mydays as varchar) day from mytable where mydays>0 Yusuf Zorlu MicrotronX |
Tue, Apr 30 2019 9:06 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Yusuf
Dunno - what happens if you try it? Roy Lambert |
Wed, May 1 2019 6:11 AM | Permanent Link |
Yusuf Zorlu MicrotronX - Speditionssoftware vom Profi | Roy Lambert wrote:
<< Dunno - what happens if you try it? with cast: select current_date()-interval cast(mydays as varchar) day from mytable where mydays>0 ElevateDB Error #700 An error was found in the statement at line 1 and column 33 (Expected interval constant but instead found cast) without cast: select current_date()-interval mydays day from mytable where mydays>0 ElevateDB Error #700 An error was found in the statement at line 1 and column 33 (Expected interval constant but instead found mydays) So it seems that the parameter for interval can't be another field. Any tricks to get this work? Yusuf Zorlu MicrotronX |
Wed, May 1 2019 6:16 AM | Permanent Link |
Fernando Dias Team Elevate | Yusuf ,
What type is "mydays" ? -- Fernando Dias [Team Elevate] |
Wed, May 1 2019 7:15 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Yusuf
I'm guessing from part of the statement that mydays is integer in which case select current_Date - cast(mydays as interval day) from mytable should work. Wether it gives you what you want is something else though. Roy Lambert |
Thu, May 2 2019 4:04 AM | Permanent Link |
Yusuf Zorlu MicrotronX - Speditionssoftware vom Profi | Roy Lambert wrote:
<< select current_Date - cast(mydays as interval day) from mytable << should work. Wether it gives you what you want is something else though. Thank you very much Roy, that query is working. Sometimes we don't see the forest because of too much trees... Yusuf Zorlu MicrotronX |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |