« Back to Administration XML Questions

RE: CAST in executeSQLQuery

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi all,
 
We need to get some informations from the extensionmobilitydynamic table requesting via axl executeSQLQuery.
 
Is there a way to cast the unix timestamp from the "DateTimeStamp" column to a "readable" datetime field, during the query?
 
At the moment the query looks like this
select enduser.userid, device.name from extensionmobilitydynamic,
device, enduser where extensionmobilitydynamic.fkdevice = device.pkid and 
extensionmobilitydynamic.fkenduser_lastlogin = enduser.pkid and
extensionmobilitydynamic.fkenduser IS NULL
now i need the lastLoggedOn users for the last week only.
 
I've tried the following queries, but nothing would work:
 
select cast(DateTimeStamp as DateTime)…

<!--[if !supportLists]-->

select …..where datetimestamp >= UNIX_TIMESTAMP(‘2012-10-20’)
select date(DateTimeStamp)…
 
CUCM Version: 8.6.1
 
kind regards
rené

<!---->

The UCM database use Informix IDS, reference herer:
 
 
Some research led me to this, which seems to be a step in the right direction:
 
select dbinfo('utc_to_datetime',datetimestamp) as dt from extensionmobilitydynamic
-------------------
2011-09-12 12:51:18.0
2012-04-17 16:42:34.0
2012-07-19 16:12:48.0
2012-02-27 16:20:59.0
 

Hi David,
 
Thank you, thats exactly the query i'm looking for!