function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KhaledZeroKhaledZero 

Query SQL to SOQL

Hi,

I want write my query whith SOQL:

Selecte User.Username, CollaborationGroup.Name, CollaborationGroup.LastModifiedDate 
From User, CollaborationGroup
Where User.Id = CollaborationGroup.OwnerID AND CollaborationGroup.LastModifiedDate < 2013-04-20T14:00:00.000Z

 thx.

Best Answer chosen by Admin (Salesforce Developers) 
KhaledZeroKhaledZero

solution:

 

SELECT Owner.Username, LastFeedModifiedDate, Name, OwnerId FROM CollaborationGroup WHERE LastModifiedDate < LAST_N_DAYS:90

 

All Answers

souvik9086souvik9086

Check this

 

Select u.name, cg.Name, cg.LastModifiedDate
From CollaborationGroup cg, User u
Where u.Id = cg.OwnerID AND cg.LastModifiedDate < 2013-04-20T14:00:00.000Z

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

KhaledZeroKhaledZero

thx @,

I tested this query whith Force.com Explorer but it don't work

 

ERROR:

MALFORMED_QUERY:

Where u.Id = cg.OwnerID AND cg.LastModifiedDate

 

ERROR at Row 3:Colum:13

unewpected token: 'cg.OwnerID'

souvik9086souvik9086

Hi, What is the relation between this two objects?

If user is the parent then it needs to work.

 

Select u.name, cg.Name, cg.LastModifiedDate
From CollaborationGroup cg, cg.User u
Where u.Id = cg.OwnerID AND cg.LastModifiedDate < 2013-04-20T14:00:00.000Z

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

 

KhaledZeroKhaledZero

hi,

there is an error whit this query :

Select u.name, cg.Name, cg.LastModifiedDate
From CollaborationGroup cg, cg.User u
Where u.Id = cg.OwnerID AND cg.LastModifiedDate < 2013-04-20T14:00:00.000Z

 when i treied to run it in Force.com Explorer

you can see the image of my error  it in this link: click here

 

Thx

KhaledZeroKhaledZero

solution:

 

SELECT Owner.Username, LastFeedModifiedDate, Name, OwnerId FROM CollaborationGroup WHERE LastModifiedDate < LAST_N_DAYS:90

 

This was selected as the best answer