You need to sign in to do that
Don't have an account?
Dwayne Taylor
SOQL Date Locale - Can filter by Locale date range with LAST_WEEK but the SELECT DATE comes out as UTC
Hi Team,
I have been working with Analytics Edge for large data dumps into excel which has worked well up until now (great tool fyi), I have realised that I have an issue with dates. I can filter the data "WHERE CreatedDate = LAST_WEEK" and it respects our Locale settings in Salesforce but the SELECT CreatedDate is coming out as UTC, so being in Melbourne +11 GMT everything before 11am is coming through as yesterday.
Example the filter is Monday to Sunday last week (7th being the beginning of the week)
Salesforce Data as presented 07/03/2016 06:00
SOQL Data 2016-03-06T19:00:07.000+0000
Ideally I would rather the output be in the same format DD/MM/YYYY but handling this in excel, but really need the date being correct with +11 timezone.
How is this generally handled on a SQL level?
Dwayne
I have been working with Analytics Edge for large data dumps into excel which has worked well up until now (great tool fyi), I have realised that I have an issue with dates. I can filter the data "WHERE CreatedDate = LAST_WEEK" and it respects our Locale settings in Salesforce but the SELECT CreatedDate is coming out as UTC, so being in Melbourne +11 GMT everything before 11am is coming through as yesterday.
Example the filter is Monday to Sunday last week (7th being the beginning of the week)
Salesforce Data as presented 07/03/2016 06:00
SOQL Data 2016-03-06T19:00:07.000+0000
Ideally I would rather the output be in the same format DD/MM/YYYY but handling this in excel, but really need the date being correct with +11 timezone.
How is this generally handled on a SQL level?
Dwayne
Bit of a bugger, built the formula for those who maybe chasing it in Excel
Where AC19 = 2016-03-06T19:00:07.000+0000 and 13 being 24 - 11 GMT
=IFERROR(IF(MID(LEFT(AC19,FIND(":",AC19)-1),FIND("T",AC19)+1,LEN(AC19))>13,DATEVALUE(LEFT(SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000",""),FIND(" ",SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000","")&" ")-1))+1,DATEVALUE(LEFT(SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000",""),FIND(" ",SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000","")&" ")-1))),"")
Dwayne
=IFERROR(IF(VALUE(MID(LEFT(AC19,FIND(":",AC19)-1),FIND("T",AC19)+1,LEN(AC19)))>13,DATEVALUE(LEFT(SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000",""),FIND(" ",SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000","")&" ")-1))+1,DATEVALUE(LEFT(SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000",""),FIND(" ",SUBSTITUTE(SUBSTITUTE(AC19,"T"," "),".000+0000","")&" ")-1))),"")