473,499 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controlling Dates in Access 2000

Does anyknow how to control dates in acess 2000, the thing is I want
to search for records using a form by date. I will be using a between
date search box. But i want to enter say todays date but retrieve the
results for exactly one month later.

E.G.
I if I enter 10-05-04 to 14-05-04 I want to see the records for
exactly 30/31 days later.

I was thinking could I manipulate the "Today'sDate" function + 30days.
that way when I open the form to search for results, instead of seeing
today's date in the textboxes, I will see the date for a months time.

Kindest regards
Nov 12 '05 #1
3 1896
On 10 May 2004 04:19:46 -0700, Cillies wrote:
Does anyknow how to control dates in acess 2000, the thing is I want
to search for records using a form by date. I will be using a between
date search box. But i want to enter say todays date but retrieve the
results for exactly one month later.

E.G.
I if I enter 10-05-04 to 14-05-04 I want to see the records for
exactly 30/31 days later.

I was thinking could I manipulate the "Today'sDate" function + 30days.
that way when I open the form to search for results, instead of seeing
today's date in the textboxes, I will see the date for a months time.

Kindest regards
I find your question a bit confusing. On the one hand your first
paragraph states you wish to enter (say) todays date and retrieve
records for exactly one month later. So if today is May 10, 2004, you
wish records for date of June 10, 2004 ONLY.

Then, in the next paragraph, you write: I if I enter 10-05-04 to 14-05-04 I want to see the records for exactly 30/31 days later. <


What is it you wish to do? Enter May 05 OR enter May 14 and return
records of June 05 or June 14, OR do you wish to enter both a start
(May 05) and an end (May 14) and return records between Jun 05 and
June 14th?

The problem with looking for records within a 1 month span and using a
DateField + 30 days is that a month can be 28, 29, 30, or 31 days in
length.

Access has a DateAdd() function that will take into account the
different month lengths.

On an form, add an unbound text control.
Set it's format property to a valid date format.
Name this control "FromDate".
Add another unbound control as above.
Name this one "ToDate".

You can then search for a variety of date criteria combinations.
1) In the query, on the Date field's criteria line, write:
Between forms!FormName!FromDate and
DateAdd("m",1,forms!FormName!FromDate)

The above function will return all records between the date on the
form and the same date, one month later.

2) You can adapt the above to whichever of the above scenarios you
wish:
Between DateAdd("m",1,forms!FormName!FromDate) and
DateAdd("m",1,forms!FormName!ToDate)

The above will find records for the period between one month after the
entered From and the To dates. If you have entered both May 5 and May
14, the records returned will be between June 5 and June 14th.

Look up the DateAdd function in VBA help.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2
Ray
le*@prologic.ie (Cillies) wrote in message news:<ba**************************@posting.google. com>...
Does anyknow how to control dates in acess 2000, the thing is I want
to search for records using a form by date. I will be using a between
date search box. But i want to enter say todays date but retrieve the
results for exactly one month later.

E.G.
I if I enter 10-05-04 to 14-05-04 I want to see the records for
exactly 30/31 days later.

I was thinking could I manipulate the "Today'sDate" function + 30days.
that way when I open the form to search for results, instead of seeing
today's date in the textboxes, I will see the date for a months time.

Kindest regards


Hello,

I'm confused too!!!

Why not just enter the dates you need in the
Starting and Ending date fields, which would
be the 30/31 days later you require?

Ray
Nov 12 '05 #3
Sorry Guys, I want to make the date search as dynamic as possible. You
see the thing is the user will only require the records from one month
ahead of the day that they are using the database.

And I also wanted to make it search for result over the period of a
week as opposed to one day, that's why I entered two dates.

so you'll will open the form and have two dates: 1=exactly 1 month
from todays date and 2= exactly 1week later than date 1.

So that all the user will see will be all records for a month in
advance over the period of a week.

therefore all the user has to do is click preview reports.

(Please note that this will only be the default value, if the user
then clicks in the date boxes they can search for what ever dates they
wish.)

I know I could build it without all this hassel, but as I said I want
to make it as user friendly as possible.

And thanks for the quick reply's. Oh! fredg I haven't had a chance to
try your suggestion yet but I did get to go through it and I think its
what I am looking for, so thank for your time and support. Its is much
appreciated.

Kindest regards.
Nov 12 '05 #4

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

Similar topics

5
6507
by: Mal | last post by:
Hello. I have a database that tracks reservations at a campground. I want to be able to make a calendar type report that shows how many people are here in given period. Stored for each...
2
8379
by: Paul# | last post by:
how do i query for a record between two dates using Access 2000? right now Im doing this: SELECT * FROM tblDateTotal WHERE .<>0 And . Between 1/1/1901 And 10/10/2050;
3
11201
by: Lynn A. | last post by:
I have to perform an import from an excel file to Access. The file comes originally as a csv file. I have to delete some rows and columns, then change the formatting of some columns. I am using...
1
1058
by: tangokilo | last post by:
Hi, I am at a loss! So please excuse me as a true novice at this....!!! How can I compare dates in a windows form (not web form) using VB.NET and SQL 2000? For example, one date is blank...
8
2163
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
10
9856
by: John | last post by:
Hi I have a form with tow fields for dates in dd/mm/yyyy format. I am trying to use the fields in a query's where clause as below; "SELECT * " & _ "FROM Orders " & _ " WHERE Orders.)>= #" &...
1
15541
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
4
3319
by: Jeff Goodman | last post by:
If there is a better newsgroup to post this in, please let me know. I am a relatively new VB.NET/SQL 2000 programmer. I am working with data imported into SQL2K from Access. Many of the dates...
5
2105
by: Dave | last post by:
Hello, I have a possible problem exporting a text field that happens to contain dates (but is not a date field) when using TransferText in MS Access 2000. I am exporting a query to a text...
0
7131
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
7007
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
7220
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...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.