A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date or Time range



 
 
Thread Tools Display Modes
  #1  
Old October 3rd, 2004, 04:33 PM
LtFass
external usenet poster
 
Posts: n/a
Default Date or Time range

I am building a program for a fire dept to keep trak of thier daily log. I
have a form where the daily data is entered. below the form is subform bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift. The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date() function
works fine as a criteria however it changes at midnite and then the query
only shows the activity after the new date is entered.
  #2  
Old October 3rd, 2004, 06:48 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

You need to tell us information about how you're storing date and time
values (assuming that you are) in the table. Are you storing the date/time
as a single field (good idea if you are)? If yes, try a criterion expression
similar to this:

Between Date() + 8/24 And Date() + 8/24 + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
...
I am building a program for a fire dept to keep trak of thier daily log. I
have a form where the daily data is entered. below the form is subform

bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift. The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date() function
works fine as a criteria however it changes at midnite and then the query
only shows the activity after the new date is entered.



  #3  
Old October 3rd, 2004, 10:15 PM
LtFass
external usenet poster
 
Posts: n/a
Default

Umm The Date is stored in a field called date and is formatted as 99/99/9999
the time is stored in two fields start time and end time and is formatted as
99:99 . I placed the string below in the criteria and MS saw fit to include
the # before the 8/24 and included the year as if it was a date instead of an
equation. Thank you for help as this was a problem with our old system

"Ken Snell [MVP]" wrote:

You need to tell us information about how you're storing date and time
values (assuming that you are) in the table. Are you storing the date/time
as a single field (good idea if you are)? If yes, try a criterion expression
similar to this:

Between Date() + 8/24 And Date() + 8/24 + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
...
I am building a program for a fire dept to keep trak of thier daily log. I
have a form where the daily data is entered. below the form is subform

bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift. The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date() function
works fine as a criteria however it changes at midnite and then the query
only shows the activity after the new date is entered.




  #4  
Old October 4th, 2004, 01:00 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Why store the date and time separately? They can be in the same field.

However, to search for both values, I recommend that your query include a
calculated field that combines the date field and the start time (I assume
that that is the time field that you want?):

CombDateTime: [DateField] + [StartTimeField]

Then use this criterion expression for this calculated field:

Between Date() + #8:00 AM# And Date() + #7:59 AM# + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
news
Umm The Date is stored in a field called date and is formatted as

99/99/9999
the time is stored in two fields start time and end time and is formatted

as
99:99 . I placed the string below in the criteria and MS saw fit to

include
the # before the 8/24 and included the year as if it was a date instead of

an
equation. Thank you for help as this was a problem with our old system

"Ken Snell [MVP]" wrote:

You need to tell us information about how you're storing date and time
values (assuming that you are) in the table. Are you storing the

date/time
as a single field (good idea if you are)? If yes, try a criterion

expression
similar to this:

Between Date() + 8/24 And Date() + 8/24 + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
...
I am building a program for a fire dept to keep trak of thier daily

log. I
have a form where the daily data is entered. below the form is subform

bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift.

The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date()

function
works fine as a criteria however it changes at midnite and then the

query
only shows the activity after the new date is entered.






  #5  
Old October 4th, 2004, 05:33 AM
LtFass
external usenet poster
 
Posts: n/a
Default

Ken, Thank you so much I belive that it will work (at least in the small
amount of test I have done so far) I will probably have more questions as
time goes but thanks it was a great help!!!!!

"Ken Snell [MVP]" wrote:

Why store the date and time separately? They can be in the same field.

However, to search for both values, I recommend that your query include a
calculated field that combines the date field and the start time (I assume
that that is the time field that you want?):

CombDateTime: [DateField] + [StartTimeField]

Then use this criterion expression for this calculated field:

Between Date() + #8:00 AM# And Date() + #7:59 AM# + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
news
Umm The Date is stored in a field called date and is formatted as

99/99/9999
the time is stored in two fields start time and end time and is formatted

as
99:99 . I placed the string below in the criteria and MS saw fit to

include
the # before the 8/24 and included the year as if it was a date instead of

an
equation. Thank you for help as this was a problem with our old system

"Ken Snell [MVP]" wrote:

You need to tell us information about how you're storing date and time
values (assuming that you are) in the table. Are you storing the

date/time
as a single field (good idea if you are)? If yes, try a criterion

expression
similar to this:

Between Date() + 8/24 And Date() + 8/24 + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
...
I am building a program for a fire dept to keep trak of thier daily

log. I
have a form where the daily data is entered. below the form is subform
bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift.

The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date()

function
works fine as a criteria however it changes at midnite and then the

query
only shows the activity after the new date is entered.






  #6  
Old October 4th, 2004, 06:23 AM
LtFass
external usenet poster
 
Posts: n/a
Default

I am use the dates and seperate times to track other activities for specfic
engines. Thanks again for your help

"LtFass" wrote:

Ken, Thank you so much I belive that it will work (at least in the small
amount of test I have done so far) I will probably have more questions as
time goes but thanks it was a great help!!!!!

"Ken Snell [MVP]" wrote:

Why store the date and time separately? They can be in the same field.

However, to search for both values, I recommend that your query include a
calculated field that combines the date field and the start time (I assume
that that is the time field that you want?):

CombDateTime: [DateField] + [StartTimeField]

Then use this criterion expression for this calculated field:

Between Date() + #8:00 AM# And Date() + #7:59 AM# + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
news
Umm The Date is stored in a field called date and is formatted as

99/99/9999
the time is stored in two fields start time and end time and is formatted

as
99:99 . I placed the string below in the criteria and MS saw fit to

include
the # before the 8/24 and included the year as if it was a date instead of

an
equation. Thank you for help as this was a problem with our old system

"Ken Snell [MVP]" wrote:

You need to tell us information about how you're storing date and time
values (assuming that you are) in the table. Are you storing the

date/time
as a single field (good idea if you are)? If yes, try a criterion

expression
similar to this:

Between Date() + 8/24 And Date() + 8/24 + 1

--

Ken Snell
MS ACCESS MVP

"LtFass" wrote in message
...
I am building a program for a fire dept to keep trak of thier daily

log. I
have a form where the daily data is entered. below the form is subform
bound
to a query that shows all of the activity for the day.
Problem I want them only to see what pretains to the current shift.

The
shift begins at 08:00 and ends 24 hrs later at 07:59 the Date()

function
works fine as a criteria however it changes at midnite and then the

query
only shows the activity after the new date is entered.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date and Time Display of Messages Received and Messages Sent jaye General Discussion 1 September 29th, 2004 12:13 PM
Inserting Query's Date Range in a Report Chip Rose Setting Up & Running Reports 2 July 13th, 2004 05:39 PM
Aggregating Date Data into Weeks and Quarters Roger Running & Setting Up Queries 3 July 11th, 2004 05:56 PM
Calculating (Date and Time) differences Madcap Worksheet Functions 0 April 27th, 2004 08:56 AM
Offset formula to add range depending on date Todd Worksheet Functions 3 November 22nd, 2003 06:12 PM


All times are GMT +1. The time now is 09:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.