Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 10 of 11 total |
Days between two dateTimes? |
Sun, Jun 11 2023 7:13 PM | Permanent Link |
Ian Branch | Hi Team,
I need to get the number of whole days between two datetimes. I thought this would give it to me but.. "select Cast(DateSent - DateTime Day as Integer) as iDays from APJobtickets" DateSent and DateTime are both DateTimes. I get this error. "ElevateDB Error #700 An error was found in the statement at line 1 and column 33 (Expected AS or , but instead found Day)" Help! Regards & TIA, Ian |
Mon, Jun 12 2023 1:36 AM | Permanent Link |
Yusuf Zorlu MicrotronX - Speditionssoftware vom Profi | Ian Branch wrote:
> Hi Team, > I need to get the number of whole days between two datetimes. > I thought this would give it to me but.. > "select Cast(DateSent - DateTime Day as Integer) as iDays from > APJobtickets" DateSent and DateTime are both DateTimes. > I get this error. > "ElevateDB Error #700 An error was found in the statement at line 1 > and column 33 (Expected AS or , but instead found Day)" > > Help! > > Regards & TIA, > Ian Hi Ian, "select cast("DateSend"-"Day" as integer) as iDays from APJobtickets" should work. Brgds, Yusuf |
Mon, Jun 12 2023 2:14 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
select CAST ((DateSent - DateTime ) DAY AS INTEGER) as iDays from APJobtickets If you just want it for display purposes and don't want to do arithmetic on individual rows (eg SUM will work) select (DateSent - DateTime ) DAY as iDays from APJobtickets I don't know if it rounds up or down or does bankers rounding so you'd need to test Roy Lambert |
Mon, Jun 12 2023 2:29 PM | Permanent Link |
Ian Branch | Hi Roy,
Neither work. I wonder if it is because I have a field called DateTime?? Ian |
Tue, Jun 13 2023 2:16 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
Works here in EDBManager 2.35b3 Try putting DateTime in double quotes Roy Lambert |
Tue, Jun 13 2023 3:13 PM | Permanent Link |
Ian Branch | Hi Roy,
Well that was interesting. It didn't work for me. On a whim I deleted edbmgr.ini and rebuilt the Database connection. All good now. Must have picked up some corruption somewhere/sometime. Tks for your time & input. Ian |
Wed, Jun 14 2023 2:25 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
I have a small utility I wrote to go through the ini file and delete most of it (leaves session & EDB config information alone). If you want a copy I'll post source & exe to the binaries ng Roy Lambert |
Wed, Jun 14 2023 5:05 AM | Permanent Link |
Ian Branch | Yes please & thank you.
Ian |
Wed, Jun 14 2023 7:18 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
In binaries now as "Ini clean up" Roy Lambert |
Wed, Jun 14 2023 4:42 PM | Permanent Link |
Ian Branch | Tks Roy,
All good. Builds & Runs under D11.3. |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |