Site Menu
- Home
- Products
- NexusDB
- Nexus Quality Suite
- NexusDB Drivers & Connectors
- Nexus Remoting
- Nexus Memory Manager
- Some of our Customers
- Testimonials and use(r)s
- Downloads
- Documentation
- Support
- Pricing & Orders
- About
- Community
- My Nexus
- Recently Updated ...
- Search...
- Site Login
Search
GetDateTimeInterval
Wed, 01/07/2009 - 15:08 | hdanzl
0
Return the interval between two dates.
create function GetDateTimeInterval ( dt1 timestamp, dt2 timestamp, /* 1: YEAR 2: MONTH 3: DAY 4: HOUR 5: MINUTE 6: SECOND */ interval_type smallint ) returns bigint begin return case interval_type when 1 then (cast(dt1 as extended)-cast(dt2 as extended))/365.25+0.0025 when 2 then ((cast(dt1 as extended)-cast(dt2 as extended))/365.25+0.0025)*12 when 3 then cast(dt1 as extended)-cast(dt2 as extended) when 4 then (cast(dt1 as extended)-cast(dt2 as extended))*24 when 5 then (cast(dt1 as extended)-cast(dt2 as extended))*1440 when 6 then (cast(dt1 as extended)-cast(dt2 as extended))*86400 end; end;
Category:
SQL Functions & Procedures
Current Version:
1.00
Supported Products:
NexusDB V2
NexusDB V3
Questions? Problems?
- Interested to buy but something put you off?
- Can't find what you're looking for?
- Have a suggestion?
Let us know. If you're having trouble contacting us, please check here.
Site Updates
- Dec 4 2024 - 1:53pm
- Dec 4 2024 - 1:48pm
- Nov 19 2024 - 1:04pm
- Oct 17 2024 - 10:27am
- Jul 24 2024 - 1:22pm