You need to sign in to do that
Don't have an account?
出力用
SOQL Date Literals
Hello.I am new using SFDC and i have a problem now.
I want to select some data that was created 14 days ago. so i wrote soql like this:
Select Id, CreatedDate FROM ***** WHERE CreatedDate < Last_N_DAYs:14 order by CreatedDate DESC
for example today is 19th so i want to get the date before 5th, but the latest date i get is 2016-08-03T23:34:01.000+0000
FYI i am in UTC 9 time zone. but it is still not right considering the time zone thing.
I appriciate if someone can tell me what is wrong with it. thanks.
I want to select some data that was created 14 days ago. so i wrote soql like this:
Select Id, CreatedDate FROM ***** WHERE CreatedDate < Last_N_DAYs:14 order by CreatedDate DESC
for example today is 19th so i want to get the date before 5th, but the latest date i get is 2016-08-03T23:34:01.000+0000
FYI i am in UTC 9 time zone. but it is still not right considering the time zone thing.
I appriciate if someone can tell me what is wrong with it. thanks.
Hi,
Please try below soqls
SELECT Id FROM Account WHERE CreatedDate < 2016-08-03T01:02:03Z
OR
SELECT Id FROM Account WHERE CreatedDate < LAST_N_DAYs:60 order by CreatedDate DESC
Thanks,
Rakesh
Try this Query
Select Id, CreatedDate FROM ***** WHERE CreatedDate = Last_N_DAYs:14 order by CreatedDate DESC. Remove ">" operator and use "=" operator.
~Thanks
Onkar
I want to use this query in a batch file so it can do it for me automaticly every week. so i can not point at just one specific date. and the second query, can you tell me why is it LAST_N_DAYS:60 not any other numbers?
by using "=", i think i will get all date from last 14 days. but i want the data which was created 14 days ago and older.
which is like "~14 days ago", not "14 days ago ~now".
do you have any ideas?
Hi,
Can you just let me know your ORG Time zone.
~Onkar Kumar
It's GMT+09:00.
Thank you.