Help get this topic noticed by sharing it on Twitter, Facebook, or email.

When I run a query with the DAY_ONLY function, only the year is returned

In the following query:

SELECT
*
FROM OPENQUERY(SALESFORCE_S, '
SELECT
DAY_ONLY(LastModifiedDate), COUNT()
FROM Account
GROUP BY DAY_ONLY(LastModifiedDate)
LIMIT 100
')

The DAY_ONLY(LastModifiedDate) function appears to only return the year part of the date. The salesforce guide seems to indicate I should expect the date portion of a datetime field (2009-09-22 for example). Am I just misinterpreting the proper use of this function?

Some of the results:

expr0 expr1
----------- -----------
2006 1
2010 1
2012 19368
2012 51432
2012 27
2012 19
2012 14
2012 33
2012 16

Thanks!
1 person has
this question
+1
Reply