WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

What expression is needed to select date&time 3 times a day?

 
   Home -> Office other -> General Discussions RSS
Next:  frontpage 2003  
Author Message
jo

External


Since: Sep 21, 2007
Posts: 17



(Msg. 1) Posted: Mon Nov 02, 2009 3:46 am
Post subject: What expression is needed to select date&time 3 times a day?
Archived from groups: microsoft>public>access (more info?)

I have a report that shows items not checked in the last 8 hours. But now I
would like another report to show what was checked between the following
shifts:
6am-2pm
2pm-10pm
10pm-6am
Can this be done?
Back to top
Login to vote
Stefan Hoffmann

External


Since: Nov 01, 2006
Posts: 134



(Msg. 2) Posted: Mon Nov 02, 2009 9:05 am
Post subject: Re: What expression is needed to select date&time 3 times a day? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hi Jo,

jo wrote:
> I have a report that shows items not checked in the last 8 hours. But now I
> would like another report to show what was checked between the following
> shifts:
> 6am-2pm
> 2pm-10pm
> 10pm-6am
> Can this be done?
Yes, you need the Partition() function as group expression:

=Partition(Hour([checkedAt])*60+Minute([checkedAt]);0;1440;480)

The only thing you need to adjust is shift offset. So instead of the
time value use:

DateAdd("h";-6;[checkedAt])

Or use it in a query.


mfG
--> stefan <--
Back to top
Login to vote
jo

External


Since: Sep 21, 2007
Posts: 17



(Msg. 3) Posted: Tue Nov 03, 2009 5:51 am
Post subject: Re: What expression is needed to select date&time 3 times a day? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Stefan thanks for your reply can I add this to a query as an expression
and where it says [checkAt] what would I put in that the time?


"Stefan Hoffmann" wrote:

> hi Jo,
>
> jo wrote:
> > I have a report that shows items not checked in the last 8 hours. But now I
> > would like another report to show what was checked between the following
> > shifts:
> > 6am-2pm
> > 2pm-10pm
> > 10pm-6am
> > Can this be done?
> Yes, you need the Partition() function as group expression:
>
> =Partition(Hour([checkedAt])*60+Minute([checkedAt]);0;1440;480)
>
> The only thing you need to adjust is shift offset. So instead of the
> time value use:
>
> DateAdd("h";-6;[checkedAt])
>
> Or use it in a query.
>
>
> mfG
> --> stefan <--
> .
>
Back to top
Login to vote
Stefan Hoffmann

External


Since: Nov 01, 2006
Posts: 134



(Msg. 4) Posted: Tue Nov 03, 2009 10:05 am
Post subject: Re: What expression is needed to select date&time 3 times a day? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hi Jo,

jo wrote:
> Hi Stefan thanks for your reply can I add this to a query as an expression
> and where it says [checkAt] what would I put in that the time?
Yes, copy it into the field column like this:

Shift:
Partition(Hour(DateAdd("h";-6;[checkedAt]))*60+Minute(DateAdd("h";-6;[checkedAt]));0;1440;480)

And replace [checkedAt] with your field name.

As SQL:

SELECT *,
Partition(Hour(DateAdd("h";-6;[checkedAt]))*60+Minute(DateAdd("h";-6;[checkedAt]));0;1440;480)
AS [Shift]
FROM [yourTable]


mfG
--> stefan <--
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support