![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 4 of 4 total |
![]() |
Tue, May 11 2010 7:10 AM | Permanent Link |
Hedley Muscroft | Hi Tim,
Here's the SQL to reproduce the problem :- ------------------------------- create table test (name varchar(250), dob date); insert into test values ('Bob', date '1970-1-1'); ------------------------------- Now execute this statement :- ------------------------------- select name, dob, (current_date-dob) year from test ------------------------------- In EDB Manager (UNICODE), we correctly get :- Bob | 1970-1-1 | 40 Under .NET we get := Bob | 1970-1-1 | 480 Seems to be calculating the number of months? Thanks, Hedley |
Tue, May 11 2010 3:19 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Hedley,
<< Seems to be calculating the number of months? >> It is the number of months. Unfortunately, .NET does not have INTERVAL type support, so we have to return the value as a raw integer (months is the base unit of measure). I've added functions to the VCL data access components to allow for translation of INTERVAL values to their proper display representation, which is what the EDB Manager uses and why it returns the correct value in the result set grid. For now, use this: select name, dob, cast((current_date-dob) year AS INTEGER) from test and you'll see the correct value. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, May 21 2010 12:18 PM | Permanent Link |
curt McGonkulator, Inc. | Actually, .NET does support intervals, but the data type is called "System.TimeSpan"
|
Fri, May 21 2010 3:09 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Curt,
<< Actually, .NET does support intervals, but the data type is called "System.TimeSpan" >> Unfortunately, that only covers part of the intervals in the SQL standard (day-time intervals). It doesn't cover year-month intervals. However, it's at least something, so I'll add some Get/Set methods for them. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |