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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection formulae not working 1

Status
Not open for further replies.

ddrake

Technical User
Mar 19, 2003
92
Hi all,
I think I've missed something obvious. The following formulae isn't pulling any records. What have I missed?
Thanks!
Dave

({HPD_HelpDesk.DayOfWeek} in ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] AND
TimeValue ({HPD_HelpDesk.Create Time}) > TimeSerial (17,0,0) AND
TimeValue ({HPD_HelpDesk.Create Time}) < TimeSerial (7,0,0)) OR
({HPD_HelpDesk.DayOfWeek} in [&quot;Saturday&quot;, &quot;Sunday&quot;])

DayOfWeek field is just text. Create Time is a date/time field.

Running Crystal 9 (Remedy 5 integration and SQL2K db)
 
My apologies, I should've mentioned what we're looking for with the formulae. [blush]

Trying to pull all items that were created either on (Saturday or Sunday) or (Monday-Friday between 5PM and 7AM the next day). Thanks!

Dave
 
Dave,

Try this

({HPD_HelpDesk.DayOfWeek} in [&quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;] AND
TimeValue ({HPD_HelpDesk.Create Time}) > TimeSerial (17,0,0) AND
TimeValue ({HPD_HelpDesk.Create Time}) < TimeSerial (7,0,0)) OR
({HPD_HelpDesk.DayOfWeek} in &quot;Saturday&quot;, &quot;Sunday&quot;)


Kchaudhry
 
Oops just realized that my &quot;[]&quot; are missing too. Here it is again

({HPD_HelpDesk.DayOfWeek} in [&quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;] AND
TimeValue ({HPD_HelpDesk.Create Time}) > TimeSerial (17,0,0) AND
TimeValue ({HPD_HelpDesk.Create Time}) < TimeSerial (7,0,0)) OR
({HPD_HelpDesk.DayOfWeek} in [&quot;Saturday&quot;, &quot;Sunday&quot;])


Kchaudhry
 
Sorry, we have the same formulae LOL

The board must filter out [] in the posts

Thanks though!

Dave
 
Try:

({HPD_HelpDesk.DayOfWeek} in &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot; AND
(TimeValue ({HPD_HelpDesk.Create Time}) > TimeSerial (17,0,0) OR
TimeValue ({HPD_HelpDesk.Create Time}) < TimeSerial (7,0,0)))
OR
({HPD_HelpDesk.DayOfWeek} in &quot;Saturday&quot;, &quot;Sunday&quot;)

...since a particular time cannot be both greater than 17:00 and less than 7:00 (unless we factor in the dates). Greater than 17:00 will pick up those before midnight, and the less than 7:00 will pick up those between midnight and 7:00.

-LB

 
Forgot to uncheck the TGML:

({HPD_HelpDesk.DayOfWeek} in [&quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;] AND
(TimeValue ({HPD_HelpDesk.Create Time}) > TimeSerial (17,0,0) OR
TimeValue ({HPD_HelpDesk.Create Time}) < TimeSerial (7,0,0)))
OR
({HPD_HelpDesk.DayOfWeek} in [&quot;Saturday&quot;, &quot;Sunday&quot;])

-LB

 
Thank you! That OR made all the difference!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top