• sissyphus
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies

I ran the same query with three different times specified and got three different results. I ran the query once using "LAST_QUARTER", once using the dates describing that quarter, then three times using the dates which describe those months. Different answers!

 

Q1 08

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-01-01T00:00:01Z AND CreatedDate < 2008-03-31T23:59:59Z"

RESULT: 2012

 

 

MONTHS IN Q1 QUERIED INDIVIDUALLY

January

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-01-01T00:00:01Z AND CreatedDate < 2008-01-31T23:59:59Z"

RESULT: 663

 

February

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-02-01T00:00:01Z AND CreatedDate < 2008-02-28T23:59:59Z"

RESULT: 632

 

March

"SELECT Severity__c, S__c, Owner.Name, IsClosed, CreatedDate FROM Case WHERE CreatedDate > 2008-03-01T00:00:01Z AND CreatedDate < 2008-03-31T23:59:59Z"

RESULT: 692

 

TOTAL RESULT: 1987

 

A difference of 25!

 

How is this possible? What am I doing wrong? I need some help on this.

 

Trying to populate some charts using the PHP API but I'm getting back inconsistent numbers when I try to slice up a time period from a quarter to the individual months.
 
 
Running one query which is supposed to get back the number of deals that happened during the first quarter of this year:

               SELECT Loss_Date__c, Sales_Region__c, StageName, Amount FROM Opportunity WHERE StageName ='LOST' AND IsWon =FALSE AND Loss_Date__c > 2008-01-01 AND Loss_Date__c < 2008-01-31 ORDER BY Loss_Date__c

This query returns 381 records

When I run a similar query for the first three individual months of 08 using their respective boundary dates I get back 195, 97, and 66 records respectively which add up to 358 and makes no sense.

'Jan-08' => array('2008-01-01', '2008-01-31'),
'Feb-08' => array('2008-02-01', '2008-02-28'),
'Mar-08' => array('2008-03-01', '2008-03-31'),

Can you tell me why sales force is returning such different results?

 

When using the time shortcuts, I'm having a hard time figuring out which day of the week a SalesForce week actually starts on. Is it Monday or Sunday?
 
When using the Sales Force time shortcuts like "THIS_WEEK" and "LAST_WEEK", what day does a week end on?
Hi all!
 
I heard from a little bird that SOQL allows you to specify dates using syntax that's something like "Today", "Yesterday", "Last week", "Last Quarter", "This Quarter", etc.
 
Does anyone have a reference or URL or any leads on where I can find the syntax for this? I checked the AppExchange API docs and they don't seem to have anything.
 
Thanks in advance for any leads on this!
When using the Sales Force time shortcuts like "THIS_WEEK" and "LAST_WEEK", what day does a week end on?
I am using:
PHP toolkit-11_0b
PHP 5.1.6
Salesforce API version 11


I am trying to retrieve the Account name or id, when querying on Cases from the API, but I could not find a way to do that:

SELECT Id, Account.Name FROM Case --> Doe not work with PHP

SELECT Id, AccountId FROM Case --> No such column 'AccountId' on entity 'Case'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

SELECT Name, (SELECT Id FROM Cases WHERE Id = '".$MyCase->Id."') FROM Account --> Didn't understand relationship 'Cases' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


Someone can help me on that?
Thanks a lot,
Etienne
The PHP toolkit provides you an easy way to make Web service API method calls.

Newly supported or enhanced in this release are:
* Metadata API
* Email
* Merge
* Workflow
* EmptyRecycleBin
* Proxy Server
* LoginScopeHeader
* Header Options at the Connection Level

Click this link to enjoy.  Be sure to check out the extensive Samples section as well.


Can any one tell me how to access Contact.Name form my code below, you can see I'm echo out a few different ways but nothing seems to work:
 
$strSQL = "SELECT Id,AssetId,AccountId, Contact.FirstName, ";
$strSQL .= "CaseNumber,Subject,Status,CreatedDate,What_is_your_acronym__c,Which_product__c ";
$strSQL .= "FROM Case ORDER BY Id DESC LIMIT 2 ";
 
   $Result = $mySforceConnection->query($strSQL);
 
 if ($Result->size == 0) {
  NoRecords(0);
 }else{
 
  $records = $Result->records;
  
  foreach ($records as $record) {
  
      $sObject = new SObject($record);
   
   echo $sObject->fields->CaseNumber.":: ";
   echo $sObject->fields->Contact->FirstName."<br>";
   echo $sObject->fields->FirstName;
  }
 }