473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Specifying date and time range for report

22
Hi, I'm trying to have a report whose range is specified in a form by the user. I managed to do this successfully in the past with just dates, using Access's calendar function and the proper query. However, now I need to be able to specify an exact time as well as the date, for example April 2 6:00 PM to April 11:45 AM.

What complicates things, I believe, is that the date and time must be stored as seperate fields in the table, so I have one field for the date and another for the time at which the record was entered. Is it possible to somehow combine these two fields in the query in order to group by date and time as specified?

I've tried something like [Reports].Date+[Reports].Time Between [Form].Start and [Form].End, but this is not working. Perhaps something similar would get the job done but I can't seem to figure it out. Any help on this would be great.

Thanks...
May 1 '07 #1
3 2072
MMcCarthy
14,534 Expert Mod 8TB
Hi, I'm trying to have a report whose range is specified in a form by the user. I managed to do this successfully in the past with just dates, using Access's calendar function and the proper query. However, now I need to be able to specify an exact time as well as the date, for example April 2 6:00 PM to April 11:45 AM.

What complicates things, I believe, is that the date and time must be stored as seperate fields in the table, so I have one field for the date and another for the time at which the record was entered. Is it possible to somehow combine these two fields in the query in order to group by date and time as specified?

I've tried something like [Reports].Date+[Reports].Time Between [Form].Start and [Form].End, but this is not working. Perhaps something similar would get the job done but I can't seem to figure it out. Any help on this would be great.

Thanks...
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Format([Reports].Date & " " & [Reports].Time, "mm/dd/yyyy hh:nn") BETWEEN [Form].Start and [Form].End
Mary
May 1 '07 #2
Luongo
22
Wow, this worked great - thanks a lot for your help.

Just one more question, along these same lines - how would I be able to query for records entered in the last 12 hours, even if this crosses over into the previous day? For example, at 6 in the morning, query for records since 6pm the previous evening? Thanks again...
May 2 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Try this ...

Expand|Select|Wrap|Line Numbers
  1.  WHERE DateDiff("h",Format([Reports].Date & " " & [Reports].Time, "mm/dd/yyyy hh:nn"),Now()) <= 12
May 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Garyrek | last post by:
Hi I have a requirement where I need to make a report for each auto dealer how many hits they got on specified date range, so for each car detail page I increment the counter and total it while...
5
by: Michelle | last post by:
Hi all I have a report which displays staff absences. An absence record has a start and end date and the type of absence, ie sickness, annual leave. I have created a form which allows the...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
2
by: kaosyeti | last post by:
i have a report that tracks customer contacts by salespeople at a car dealership. the contacts are assigned several values, one of which is the date that they came in. the report is capeable of...
2
by: jennwilson | last post by:
I am trying to generate a report based on a query that will list any records where an individual has a date listed that matches the specified time for one or both of the date fields. The two fields...
19
by: ali3n8 | last post by:
Hello I have attempted to create a date range report from a query called qrycustomerinformation. The field that contains the value of my date is called Followup. When i run a report on this it is...
9
by: Mo | last post by:
After a little PHP education, my first project (to get my feet wet) is making an employee time-tracking program for our small business. *** ANY SUGGESTION, THOUGHTS, OR ADVICE WOULD BE WARMLY...
6
by: dschiewe | last post by:
Hello, This is my first time posting on here so I hope I don't ramble too much. I have a complex database that a co-worker and I created 2 years ago and that I have been adding to since then. The...
12
smithj14
by: smithj14 | last post by:
I have a form to enter start and end dates then select a worker name to filter a report. This all works fine and when the report is open in preview mode it shows the date range in the txtboxes on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.