473,395 Members | 1,624 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,395 software developers and data experts.

Query on a calculated date field

I am [still!] setting up a database for a friend who's an Optician,
using MS Access 2002. All seems to be working well, but I have hit a
snag.

There's a calculated field both in a form and a query which calculates
the date for the next appointment from a date field and the number of
months to the next appointment. That works fine.

For reminder letters, I need to have a query which allows me to select
a subsection of dates between dd/mm/yyyy and dd/mm/yyyy. However, when
I try to do this calculation using a popup form, it fails. I suspect
it's because I try to query on a field which is already calculated.
The formula I use is

Between [Forms]![SubformDates]![From:] And
[Forms]![SubformDates]![To:]

When I try to open the query, it asks me for these dates, but then
displays a subsection which bears no resemblance to the time span I
wanted. I would be grateful for any help!

Norbert
Nov 13 '05 #1
2 2298
"Norbert Lieckfeldt" <lc*****@yahoo.co.uk> wrote in message
news:fc**************************@posting.google.c om...
I am [still!] setting up a database for a friend who's an Optician,
using MS Access 2002. All seems to be working well, but I have hit a
snag.

There's a calculated field both in a form and a query which calculates
the date for the next appointment from a date field and the number of
months to the next appointment. That works fine.

For reminder letters, I need to have a query which allows me to select
a subsection of dates between dd/mm/yyyy and dd/mm/yyyy. However, when
I try to do this calculation using a popup form, it fails. I suspect
it's because I try to query on a field which is already calculated.
The formula I use is

Between [Forms]![SubformDates]![From:] And
[Forms]![SubformDates]![To:]

When I try to open the query, it asks me for these dates, but then
displays a subsection which bears no resemblance to the time span I
wanted. I would be grateful for any help!


What I have found is that the query returns different data sets. If I look
for between 1/1/2004 and 31/1/2004 I get about 1,200 data entries. If I ask
for data between 15/11/2003 and 15/12/2003 I get about 19, all dated 15
November, but in different years.

Am getting frustrated and desperate!

Norbert
Nov 13 '05 #2
Regardless of what your short date format has been set to through Regional
Settings, Access won't recognize dd/mm/yyyy dates in queries. Use the Format
function to reformat them as mm/dd/yyyy or yyyy-mm-dd.

For more information, check Allen Browne's "International Dates in Access"
at
http://members.iinet.net.au/~allenbrowne/ser-36.html or what I have at
http://members.rogers.com/douglas.j....artAccess.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Norbert Lieckfeldt" <lc*****@yahoo.co.uk> wrote in message
news:fc**************************@posting.google.c om...
I am [still!] setting up a database for a friend who's an Optician,
using MS Access 2002. All seems to be working well, but I have hit a
snag.

There's a calculated field both in a form and a query which calculates
the date for the next appointment from a date field and the number of
months to the next appointment. That works fine.

For reminder letters, I need to have a query which allows me to select
a subsection of dates between dd/mm/yyyy and dd/mm/yyyy. However, when
I try to do this calculation using a popup form, it fails. I suspect
it's because I try to query on a field which is already calculated.
The formula I use is

Between [Forms]![SubformDates]![From:] And
[Forms]![SubformDates]![To:]

When I try to open the query, it asks me for these dates, but then
displays a subsection which bears no resemblance to the time span I
wanted. I would be grateful for any help!

Norbert

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve | last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's criteria is set ats: Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the selections are 30, 60...
7
by: Arild Larsen | last post by:
Hei I'd like to find total of one field based on the size of another field Pipedim Length 2 2 2 3 2 2 1 3 1 4 3 6 3 1
5
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I...
1
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to...
15
by: Rolan | last post by:
There must be a way to enhance the performance of a query, or find a plausible workaround, but I seem to be hitting a wall. I have tried a few tweaks, however, there has been no improvement. ...
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
17
by: sharsy | last post by:
Hello guys, I would like some help in generating query criteria that will identify credit cards that have expired on an access database. The specific Field is formatted with a Data Type of...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.