![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Mon, Jan 14 2008 5:24 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Can anyone convert this to ElevateDB
(IF(_LastAccess IS NOT NULL THEN CURRENT_TIMESTAMP - _LastAccess ELSE 99999.99)) AS _LongAgo, Roy Lambert ps Were intervals invented by the same moron who decided that null <> empty string? |
Mon, Jan 14 2008 5:36 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Forgot to sat _LastAttempt is a DateTime field
Roy Lambert |
Mon, Jan 14 2008 5:46 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Made it eventually
(IF(_LastAccess IS NOT NULL THEN CAST(CAST(CURRENT_TIMESTAMP - _LastAccess AS INTERVAL DAY) AS INTEGER) ELSE 99999)) AS _LongAgo, A couple of points for anyone else trying this - DON'T use CURRENT_DATE and CURRENT_TIMESTAMP with the wrong field type - these days you get an error. Personally I don't think you should but you do. Roy Lambert |
Mon, Jan 14 2008 7:26 AM | Permanent Link |
"Ole Willy Tuv" | Roy,
<< CAST(CAST(CURRENT_TIMESTAMP - _LastAccess AS INTERVAL DAY) AS INTEGER) >> You don't need to explicitly cast the expression, since the result of datetime arithmetic is an interval. You just need to specify the type of interval you want: CAST((CURRENT_TIMESTAMP - _LastAccess) DAY AS INTEGER) Ole Willy Tuv |
Mon, Jan 14 2008 7:58 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ole
Thanks - that works well. Roy Lambert |
This web page was last updated on Monday, July 15, 2024 at 07:03 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |