Hi, Jason:

Sorry for being a little late to the table.

I'm not sure if it was mentioned in an earlier post, but one can also search by 
day of the week.  Here's how one would search for tickets submitted over ANY 
weekend, of ANY year, that are still in an open Status.

Find Open Issues that were created on a Saturday or Sunday: [It was a Help Desk 
report request from a previous manager]
'Status*' <= 3 AND (((('Arrival Time'- "01/01/70") % (7*86400)) >= (2*86400)) 
AND ((('Arrival Time'- "01/01/70") % (7*86400)) < ((4*86400))))

Broken Down:
Notice that the MOD is done over a 7 day period:    (('Arrival Time'- 
"01/01/70") % (7*86400))
This clause represents greater than or equal to Saturday at 00:00:00 (midnight) 
:   >= (2*86400)
This portion represents less than Monday:   < ((4*86400))))

Hint: January 1, 1970 was a Thursday (yeah, I'm a time geek).

Might come in handy some day. :)

Michelle

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Jason Miller
Sent: Friday, November 09, 2012 2:38 PM
To: [email protected]
Subject: Re: Query for tickets between 8 PM and 4 AM the following day

** LOL!  You are absolutely correct.  It is almost embarrassing.  That is 
exactly what I asked for and returns the same results as the example I gave.  I 
was using a 2 day time span for testing but what I didn't mention is I wanted 
to be able to run it for more than 2 days worth of tickets between those hours. 
 The added complexity I was going for allow this query to return a whole weeks 
work of tickets from 2000 to 0400.  I used two days just for getting the query 
to working with a smaller data set.

Of course there is the extra check for less than midnight and greater than 
midnight that Fred pointed out.  I just took an existing query I had for 
finding requests between two times on the same day (say 1700 - 2300), changed 
it to 0 and 24 and doubled it up with an OR.  Not ideal but it did what I 
needed for some quick analysis.  Kids, don't follow my example, do nice work 
instead  :)

Jason

On Thu, Nov 8, 2012 at 6:14 AM, Ken Pritchard 
<[email protected]<mailto:[email protected]>> wrote:
**
Hi Jason,

   I'm probably thinking a bit simplisticly, but couldn't you do the following:

'Arrival Time' >= "5/1/2012 08:00:00 PM" AND 'Arrival Time' <= "5/2/2012 
04:00:00 AM"


----- Original Message -----
From: Jason Miller<mailto:[email protected]>
Newsgroups: public.remedy.arsystem.general
To: [email protected]<mailto:[email protected]>
Sent: Wednesday, November 07, 2012 5:02 PM
Subject: Query for tickets between 8 PM and 4 AM the following day

** I am trying to run a quick and dirty search of tickets submitted from 8 PM 
and 4 AM the following day.  I using this query:

(((((( 'Arrival Time' - "1/1/1970")+3600) % 86400) >= (20 * 3600)) AND 
(((('Arrival Time' - "1/1/1970" )+3600) % 86400) < (24 * 3600))) AND 'Arrival 
Time' > "5/1/2012" AND 'Arrival Time' < "5/2/2012") OR (((((( 'Arrival Time' - 
"1/1/1970")+3600) % 86400) >= (0 * 3600)) AND (((('Arrival Time' - "1/1/1970" 
)+3600) % 86400) < (4 * 3600))) AND 'Arrival Time' > "5/2/2012" AND 'Arrival 
Time' < "5/3/2012")

I broke it down into two parts. To the left of the OR finds 8 PM to midnight 
and to the right of the OR finds midnight to 4 AM of the following day.  When I 
run each half separate it returns the expected results.  When I combine the two 
with the OR I only get results for the half (8 to midnight).

I am sure I am missing something simple.  Maybe it is time for some afternoon 
coffee?  Does anybody see my mistake?

Thanks,
Jason
_attend WWRUG12 www.wwrug.com<http://www.wwrug.com> ARSlist: "Where the Answers 
Are"_
_attend WWRUG12 www.wwrug.com<http://www.wwrug.com> ARSlist: "Where the Answers 
Are"_

_attend WWRUG12 www.wwrug.com ARSlist: "Where the Answers Are"_

----------------------------------------------------------------------
This message w/attachments (message) is intended solely for the use of the 
intended recipient(s) and may contain information that is privileged, 
confidential or proprietary. If you are not an intended recipient, please 
notify the sender, and then please delete and destroy all copies and 
attachments, and be advised that any review or dissemination of, or the taking 
of any action in reliance on, the information contained in or attached to this 
message is prohibited. 
Unless specifically indicated, this message is not an offer to sell or a 
solicitation of any investment products or other financial product or service, 
an official confirmation of any transaction, or an official statement of 
Sender. Subject to applicable law, Sender may intercept, monitor, review and 
retain e-communications (EC) traveling through its networks/systems and may 
produce any such EC to regulators, law enforcement, in litigation and as 
required by law. 
The laws of the country of each sender/recipient may impact the handling of EC, 
and EC may be archived, supervised and produced in countries other than the 
country in which you are located. This message cannot be guaranteed to be 
secure or free of errors or viruses. 

References to "Sender" are references to any subsidiary of Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Attachments that are part of this EC may have additional 
important disclosures and disclaimers, which you should read. This message is 
subject to terms available at the following link: 
http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you 
consent to the foregoing.

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

Reply via email to