You need to sign in to do that
Don't have an account?
Arun B
SOQL : Date - n days
Hello there,
I have a requirement where I need to write a where clause which needs to set the date value to '<Date>'-10 days .
For e.g: I want to query something like this:
Select Sample_Object__r.Ship_Date__c,Sample_Object__r.Transaction_Number__c,c.Quantity__c,c.Lot_Number__c from
spl_sample_object_items__c c where Sample_Object__r.Ship_Date__c>= 2008-04-01 - (10) and Sample_Object__r.Ship_Date__c <= 2008-10-18 + (10)
Any function available in SOQL or do I need to write a logic for this on the client side . Any hints would be truly appreciated !
Thanks,
Arun B
I have a requirement where I need to write a where clause which needs to set the date value to '<Date>'-10 days .
For e.g: I want to query something like this:
Select Sample_Object__r.Ship_Date__c,Sample_Object__r.Transaction_Number__c,c.Quantity__c,c.Lot_Number__c from
spl_sample_object_items__c c where Sample_Object__r.Ship_Date__c>= 2008-04-01 - (10) and Sample_Object__r.Ship_Date__c <= 2008-10-18 + (10)
Any function available in SOQL or do I need to write a logic for this on the client side . Any hints would be truly appreciated !
Thanks,
Arun B
You can add and days to dates using Date methods. I haven't tried it but I'm guess you can just add negative days to subtract.
See page 139:
http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf
Pls let me know if you have any idea on how to do this in Flex if we cannot do this stuff in SOQL directly.
Thanks,
Arun B
Sample_Object__r.Ship_Date__c>= 2008-04-01 - (10)
I think you will need to subtract 10 days from the date in Flex before you pass it to the SOQL call.
Message Edited by TehNrd on 06-11-2008 11:06 AM