• BrunoM
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies

Hello All,

 

Not sure if this is the right forum, but I am encountering a problem writing a particular query using Crystal Reports 11.2 with Salesforce.

 

I am using the Salesforce.com Driver for Crystal Reports ver 3.0 to connect.

 

An example of query I have written is:

 

{Case.CreatedDate} <= CDATETIME({?Date})and (isnull({Case.ClosedDate}) or {Case.ClosedDate} > CDATETIME({?Date}))

 

 

Now if I input a date of 2011-02-01 as my date parameter and then run the report, I get the following error:

 

Failed to retrieve data from the database

 

Database Connector Error: 'MALFORMED_QUERY:

CreatedDate<2010-02-01TO0:00:01Z AND ( OR ClosedDate >=2010-02-01T00:00:01Z)

 

ERROR at Row:1:Column:90

unexpected token: 'OR"

 

 

When I use the 'Show SQL query' function in Crystal, this is what is shows me

 

SELECT CreatedDate, ClosedDate FROM   Case WHERE  CreatedDate<2010-02-01T00:00:01Z AND ( OR ClosedDate>=2010-02-01T00:00:01Z)

 

It seems like it doesn't like the 'or' value in the query. If I break up the query and write it as 2 queries:

 

{Case.CreatedDate} <= CDATETIME({?Date})and isnull({Case.ClosedDate}) 

 

 

{Case.CreatedDate} <= CDATETIME({?Date})and {Case.ClosedDate} > CDATETIME({?Date})

 

then it seems to have no problem at all - which doesn't help me a whole lot.

 

Any ideas what I could be doing wrong here?

 

Any help is appreciated.



Trying to prevent users from setting this custom object to 'Finished' status if the boolean field In_AddOn_Grp__c is checked off and either Description__c  or Customer_Contact__c  are blank. Any ideas?

 

AND (
In_AddOn_Grp__c ,
ISPICKVAL( Project_Status__c, "Finished" ) ,
OR (
ISNULL( Description__c ),
ISNULL( Customer_Contact__c )
)
)

I need to be able to lock down the due date on assigned tasks so that the assignee cannot change it without permission from the user assigning the task.

Trying to prevent users from setting this custom object to 'Finished' status if the boolean field In_AddOn_Grp__c is checked off and either Description__c  or Customer_Contact__c  are blank. Any ideas?

 

AND (
In_AddOn_Grp__c ,
ISPICKVAL( Project_Status__c, "Finished" ) ,
OR (
ISNULL( Description__c ),
ISNULL( Customer_Contact__c )
)
)

Does anyone know how to build a formula to look up the 'Active' checkbox on Self Serve Portal User profile? The challenge I'm having is to find the field name for this checkbox. It seems to be hidden and not available for selection on 'INsert field' dropdown on Formula screen. I asked SFDC Tech Support, they also said that whole SS User Profile is hidden. Any suggestions? Thanks.

I need to write a Data Validation rule to enforce users to use the Task Subject pick list values when creating tasks or activities.

 

I've started with this but need some help finishing it:

 

IF( Subject  <> "Call, Contacted, Conversation, Fax, Handoff, Interview, Left Voicemail, Mailed Collateral, Other, Send Email, Send Letter, Send Quote, Web Meeting , value_if_true, value_if_false)

 

Thank you,

  • June 18, 2009
  • Like
  • 0