You need to sign in to do that
Don't have an account?
Sandeep M 1
Soql query on custom objects using junction object
i have three custom objects.
Bank_Account__c(Parent) --->Bank_transaction__c(child)
Bank_Account__c(Parent) --->Bank_statement__c(child)
Bank_transaction__c fields are date__c, credit__c, debit__c
Bank_statement__c fields are start_date__c, end_date__c
I just want to write a single query to get the records of Bank_transaction__c which date__c is in between start_date__c and end_date__c of bank_statement__c object. How can i achieve this
Bank_Account__c(Parent) --->Bank_transaction__c(child)
Bank_Account__c(Parent) --->Bank_statement__c(child)
Bank_transaction__c fields are date__c, credit__c, debit__c
Bank_statement__c fields are start_date__c, end_date__c
I just want to write a single query to get the records of Bank_transaction__c which date__c is in between start_date__c and end_date__c of bank_statement__c object. How can i achieve this
I don't think this can be achieved in a single query, as they have a many-to-many kind of a relationship. The best alternative is to write separate SOQL querues for both child objects, and use for loops to get a list of required records.
Thanks,
Shashank
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AVYBIA4
Thank you!