Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Help with a formula, please Post Reply Post New Topic
Author Message
StevenjE
Newbie
Newbie


Joined: 04 Jul 2011
Online Status: Offline
Posts: 1
Quote StevenjE Replybullet Topic: Help with a formula, please
    Posted: 04 Jul 2011 at 4:51am
Hi,
 
I want to return records in crystal for  June 2010 & 2011 and I only want the records that have an owner group of Service Desk.
This is my code...
{HPD_Help_Desk.Owner_Group} = "Service Desk" and
{HPD_Help_Desk.Last_Resolved_Date} in DateTime (2010, 06, 01, 00, 00, 00) to DateTime (2010, 06, 30, 23, 59, 59) or {HPD_Help_Desk.Last_Resolved_Date} in DateTime (2011, 06, 01, 00, 00, 00) to DateTime (2011, 06, 30, 23, 59, 59)
 
However when the records are returned i am getting all Owner Groups and not just Service Desk.
 
I assume it is todo with the date query? I would really appreciate some help with this to understand what I am doing wrong?
 
Thanks
Steve
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 09 Aug 2011 at 5:07am
You have to be careful when using "or".  Change your formula to this:
 
{HPD_Help_Desk.Owner_Group} = "Service Desk" and
({HPD_Help_Desk.Last_Resolved_Date} in DateTime (2010, 06, 01, 00, 00, 00) to DateTime (2010, 06, 30, 23, 59, 59) or {HPD_Help_Desk.Last_Resolved_Date} in DateTime (2011, 06, 01, 00, 00, 00) to DateTime (2011, 06, 30, 23, 59, 59))
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.