You need to sign in to do that
Don't have an account?
Amogh Babhale
Trailhead challenge of SOQL for admin
Hi All,
I trying to complete the Modudle SOQL for Admins and stuck on one stage.
In the Fourth Stage "Create Relationship Queries with Custom Objects"
The link of the mudle:-https://trailhead.salesforce.com/content/learn/modules/soql-for-admins/create-relationship-queries-with-custom-objects
I not able to colete the chanllenge where it ask to write a query and assign to list.
So the query is that
Create a query and assign the query results to the list
Get this information:
The name of the property
The broker’s email address
How long the property has been on market
(Hint: Use API names, not field names or field labels)
Object: Property
Condition: The property was listed within the last 30 days
I am Stuck on "Condition" part where they want listed Property is are within 30 days.
I wrote a query
SELECT Name, Broker__r.Email__c,Days_On_Market__c FROM Property__c WHERE
but not able to write a logic for WHERE Clause becase the listed date field is Date type field.
So how can we write the logic for WHERE Clause.
Thanks !!
I trying to complete the Modudle SOQL for Admins and stuck on one stage.
In the Fourth Stage "Create Relationship Queries with Custom Objects"
The link of the mudle:-https://trailhead.salesforce.com/content/learn/modules/soql-for-admins/create-relationship-queries-with-custom-objects
I not able to colete the chanllenge where it ask to write a query and assign to list.
So the query is that
Create a query and assign the query results to the list
Get this information:
The name of the property
The broker’s email address
How long the property has been on market
(Hint: Use API names, not field names or field labels)
Object: Property
Condition: The property was listed within the last 30 days
I am Stuck on "Condition" part where they want listed Property is are within 30 days.
I wrote a query
SELECT Name, Broker__r.Email__c,Days_On_Market__c FROM Property__c WHERE
but not able to write a logic for WHERE Clause becase the listed date field is Date type field.
So how can we write the logic for WHERE Clause.
Thanks !!
Greetings!
We have separate Trailhead team who can help you with these issues.So,can you please use the below link to reach out to them so that one of the agent will get in touch with you.
Support:https://trailhead.salesforce.com/help
Thank you!
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks,
Vinay Kumar
Thank you for your response .
This is an general query I have about SOQL topic , I am not facing any technical issue witht my Traihead account.
I will change the catogory of this quetion.
Thanks !!
Thanks,
Vinay Kumar
Itried that but did not worked
Try to check below date formats.
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Thanks,
Vinay Kumar
Please use below query and try:
[SELECT Name,Broker__r.Email__c,Days_On_Market__c from Property__c WHERE Days_On_Market__c <= 30 ]
Thanks,
Tejas
My query ran properly but still show me the error that "your dreamhouse package is not installed" which I did.
public class PropertyUtility {
public static void newListedProperties()
{
List<Property__c> newPropList = [SELECT Name, Broker__r.Email__c, Days_On_Market__c
FROM Property__c
WHERE Date_Listed__c = LAST_N_DAYS:30];
for (Property__c prop : newPropList){
String propEmail = 'Property Name: ' + prop.Name + ' Property Email: ' + prop.Broker__r.Email__c;
system.debug(propEmail);
}
}
}
WHERE Date_Listed__c =
LAST_N_DAYS:30
public class PropertyUtility {
public static void newListedProperties(){
List<Property__c> newPropList = [select name,broker__r.email__c,days_on_market__c from property__c where days_on_market__c <=30];
for(Property__c prop : newPropList)
{
String propEmail = prop.name + ':' + prop.broker__r.email__c;
System.debug(propEmail);
}
}
}
public static void newListedProperties(){
list <Property__c>newPropList = [SELECT Name,Broker__r.Email__c,Days_On_Market__c from property__c where Date_Listed__c = LAST_N_DAYS:30];
for (Property__c prop:newPropList){
string propEmail= prop.Name+':'+prop.Broker__r.Email__c;
system.debug(propEmail);
}
}
}
public static void newListedProperties(){
List<Property__c> newPropList =[Select Name ,Broker__r.Email__c,Days_On_Market__c From Property__c Where Days_On_Market__c<=30];
for(Property__c pop : newPropList){
String propEmail = 'Property Name : ' + pop.Name +', Broker Email: ' + pop.Broker__r.Email__c;
System.debug(propEmail);
}
}
}