Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection Criteria to Include Null Fields 2

Status
Not open for further replies.
Sep 11, 2008
25
US
I have the following selection critera for a report:

{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00)to datetime (currentdate) and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development" and
{HPD_Help_Desk.Product Categorization Tier 2} = "Video"

I also want to display on this same report tickets that meet the above Reported Date & Assigned Group but the Categorization Tier 2 field is null (no data appears in that field).

I entered this additional selection criteria, but it does not work:

or
{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00)to datetime (currentdate) and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development" and
IsNull({HPD_Help_Desk.Product Categorization Tier 2}) Or
{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00)to datetime (currentdate) and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development" and
InStr({HPD_Help_Desk.Product Categorization Tier 2}, " ") = 0

Please offer a solution.

Thank you,

Rachel
 
Rearrange it a little and add some parenthesis
(
IsNull({HPD_Help_Desk.Product Categorization Tier 2} and
{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00)to datetime (currentdate) and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development" and
) Or
(
InStr({HPD_Help_Desk.Product Categorization Tier 2}, " ") = 0 and
{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00)to datetime (currentdate) and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development"
)



 
You could simplify this to:

(
IsNull({HPD_Help_Desk.Product Categorization Tier 2}) or
trim({HPD_Help_Desk.Product Categorization Tier 2}) = "" or
{HPD_Help_Desk.Product Categorization Tier 2} = "Video"
)
and
{HPD_Help_Desk.Reported Date} in datetime (2008, 06, 30, 00, 00, 00) to currentdatetime and
{HPD_Help_Desk.Assigned Group} = "TS Service Delivery Solutions Development"

Not sure why you were checking for zero spaces, so I guessed you meant to check for blanks instead. Maybe I'm wrong about that.

Also, I wasn't sure why you were using datetime(currentdate)--that would return the same as just using currentdate (time = midnight). If you wanted the current time included, you should use currentdatetime. Again, I'm not sure of your intent.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top