473,386 Members | 1,602 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.

getting proper dates covered for reports

I would like some advice on the best way in MS Access, in query builder to get criteria that will include certain days.

something similar to this code:

Expand|Select|Wrap|Line Numbers
  1.  >=[Forms]![frmReportMenu]![txtStartDate] And <=[Forms]![frmReportMenu]![txtEndDate]
  2.  
I basically need to be able to run reports from a query that will gather data for all days of the month. Of course I would like to use the Between() function, but it seems there are all sorts of rules that make it not do what the book says.
I can never seem to get the final day included.

Thank yo for any help
Ken
Mar 18 '08 #1
4 1206
Stewart Ross
2,545 Expert Mod 2GB
Hi Ken. Using BETWEEN should work just as well as the above. In both cases you would need to use the '#' signs to tell the query editor that these are date values:
Expand|Select|Wrap|Line Numbers
  1.  >=#[Forms]![frmReportMenu]![txtStartDate]# And <=#[Forms]![frmReportMenu]![txtEndDate]#
  2. '  or
  3. Between #[Forms]![frmReportMenu]![txtStartDate]# And #[Forms]![frmReportMenu]![txtEndDate]#
  4.  
-Stewart
Mar 18 '08 #2
HI and thank you Stewart

Both of the expressions returned an access error
"The expressions you entered returned an invalid date value"

any thoughts on that.

Ken
Mar 18 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Sorry, Ken; the date literals don't work with such form references it seems - but what does work is to use explicit date typecasting using the CDate function. It is of the form

Expand|Select|Wrap|Line Numbers
  1. Between Cdate(forms![formname]![controlname]) AND Cdate(forms![formname]![controlname])
  2. ' or
  3. >= Cdate(forms![formname]![controlname]) AND <= Cdate(forms![formname]![controlname])
-Stewart
Mar 18 '08 #4
Hi Stewart,
Well neither of these picks up the last day. Between is supposed to and the other I would have thought would, but some internal stuff keeps it from happening I guess.

In both cases though data from the 31st was left out.

I can't believe that something this well used doesn't have a basic function that works quickly, simply and without fail, as it so important.

I can make it work with adjustments.

Thanks for trying.
Ken
Mar 18 '08 #5

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

Similar topics

6
by: Kris M | last post by:
How do i handle a null value for a date variable type. I am retrieving date data from an access database and storing the records in an array for processing. The array field has a date type and the...
52
by: Andy Dingley | last post by:
I'm using this at present: <p title="Publication date" ></p> Works fine on screen, but Fangs/Jaws just reads it as "left bracket twenty-eight slash zero slash two thousand five fifteen colon...
1
by: Michael DeLawter | last post by:
Using Access 2002. I have a chart in a report that is currently based on a query in which the user enters the start and end date for the chart to display. Both the start and end dates have been...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
0
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
7
by: evilcowstare via AccessMonster.com | last post by:
Hi, I have searched the forum for answers on this and to be honest as a novice I find it a bit confusing so apologies if it is simple. There are some searches that I want to apply to my database....
6
by: tshad | last post by:
Apparently, I can't do: Dim da2 As New OleDb.OleDbDataAdapter("Select PR, Convert(varchar,getchar(),1),F1, F2, F5, Sum(F4) from temp .... I am getting this error. 'undefined function...
2
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
8
by: Innocent2104 | last post by:
Hi there, The script below displays the attached output but as shown, it skips certain days and i need to include these to calculate my avg balance for a certain month, i.e.Nov. How do i update the...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.