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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |