473,804 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Between Date criteria problem

I have 2 querys with the following in the date criteria

Between DateAdd("m",-6,([Forms]![Maff count form]![1st date])) And
([Forms]![Maff count form]![1st date])

Between DateAdd("m",-24,([Forms]![Maff count form]![1st date])) And
DateAdd("m",-6,([Forms]![Maff count form]![1st date]))

Problem is they both look at the same day 6 months before the date entered. eg
date entered = 28/02/2004 then both querys pick up data from 28/08/2003

How do I alter the first line so that it would ( in the example given ) go from
29/08/2003 to 28/02/2004

TIA
David B

Nov 12 '05
11 4229
Bas Cost Budde <ba*@heuveltop. org> wrote in news:c1qnib$li7 $2
@news2.solcon.n l:
Lyle Fairfield wrote:
Bas Cost Budde <ba*@heuveltop. org> wrote in news:c1qcn4$li7 $1
@news2.solcon.n l:

Lyle Fairfield wrote:

>if you subtract one from a date you'll just push it back one day.

Not always.
When not?

Sub temp()
Dim d As Date
Dim m As String
d = #12:00:00 PM#
' (1899-12-30 12:00)
m = "Before: " & Format(d, "yyyy-mm-dd hh:nn")
d = d - 1
m = m & vbNewLine & "After: " & Format(d, "yyyy-mm-dd hh:nn")
Debug.Print m
MsgBox m
'Before: 1899-12-30 12:00
'After: 1899-12-30 12:00
End Sub

Hmm, yesterday never arrives... sounds a little like Transport Tycoon.


Better yet: yesterday never happened!

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #11
Lyle Fairfield wrote:
Hmm, yesterday never arrives... sounds a little like Transport Tycoon.


Better yet: yesterday never happened!

<G>

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #12

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

Similar topics

3
15952
by: David Kuhn | last post by:
I have a query with a date field criteria of: Between And When the query is run, I am asked for the Start date and then the End Date. So far, so good. The records returned are all those in between those dates and not records that are on the start or the end date. For example, I enter "09/01/03" for the start date and "09/30/03" for
4
3348
by: Greg Iocco | last post by:
Simple problem, but I've checked the newsgroups and couldn't find an answer. On the main swithboard is a command button to open a report. The report I built is based off a query, and the query is now restricted by the simple "Between And ". What I want to do is pass the values of the two parameters into some textboxes in the heading of the report (so if 12/1/03 and 12/31/03 are the parameters, I can display the entered dates in the...
1
4660
by: Jaycee66 | last post by:
Access 2000 "Between" query question: I am relatively new to MS Access and everytime I think I have a basic concept of the program it pokes me in the eye with something I think would be simple to create. I want to create 2 separate queries for a label. I would like to have the query prompt me for the date I choose to start from until the present date and the other to prompt me for the date I choose to start from and 2 additional numbers...
1
1803
by: Alain Filiatrault | last post by:
HI, I'm having a problem with the following query. Here it is in my own words : Table : T_Test id (Autonumber) dtmStartDate (Datetime) format dd-mm
8
14209
by: Paul T. Rong | last post by:
I used "between and " in a query as a criteria to a field called ShipDate. Very strange, in the case between 1.10.2003 and 31.10.2003, then the records from 31.10.2003 don't show up. I have to modify it as between 1.10.2003 and 1.11.2003 for the records from 31.10.2003 show up. anybody had same problem? I check the Access Help but didn't get any clue. Thanks in advance
6
4277
by: Tony Williams | last post by:
I have a query with this Between statement as the criteria: "Between And " If I key in June 2002 as the first quarter date and June 2004 as the second quarter date I get data for June 2002 upto March 2004 not June 2004. How can I change the Between statement to include June 2004 if I enter June 2004? TIA Tony Williams
5
5163
by: DW | last post by:
I have a query in Access 2003 that has the following criteria SELECT tblOrder.SessionDate, tblMenus.Item_Name, tblOrder.Type, Format$(tblorder!SessionDate,"Short Time") AS SessionTime, Sum(tblMenus.Item_Quantity) AS MenuCount INTO tblSessionQuery FROM tblOrder, tblMenus WHERE (((tblOrder.Order_ID)=.) AND ((Format$(!,"mm/dd/yyyy")) Between Format$(!!,"mm/dd/yyyy") And Format$(!!,"mm/dd/yyyy")))
13
10709
by: Jim Armstrong | last post by:
Hi all - This problem has been driving me crazy, and I'm hoping the answer is something stupid I am neglecting to see.... The procedure posted below is part of an Access/SQL database I have developed. Basically, the user would input a beginning and ending date, and the query goes and pulls records that meet the following criteria: 1. TradeDate is between beginning date and ending date
2
2229
by: falroc | last post by:
I have a data base that is used for billing. I have a form called a report selector form. Below is the code used to create the report from the user inputs on the form. What I want to do is add a way for the users to input dates and when they push the intake button they get all the date between the two dates the user/s input. Private Sub cmdIntake_Click() Dim strCountyName As String Dim strAgencyStatus As String Dim...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10089
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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 we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.