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

Problem with a date query

Jim
I'm having a problem with a date query..im trying to pull customer
data based on a date specified from a form to 3 months prior to the
date specified. So lets say in the form I specified 1/2/2004. I
would need all records with a date in October '03, November '03,
December '03 and January '04. Every thing ive tried hasnt worked and
im getting all types of weird recordsets..

thanks

-Jim
Nov 12 '05 #1
3 2082
Jim wrote:
I'm having a problem with a date query..im trying to pull customer
data based on a date specified from a form to 3 months prior to the
date specified. So lets say in the form I specified 1/2/2004. I
would need all records with a date in October '03, November '03,
December '03 and January '04. Every thing ive tried hasnt worked and
im getting all types of weird recordsets..

thanks

-Jim

The SQL for the query should become:

select * from yourtable where yourdate between #10/1/2003# and #2/1/2004#

Date is american format, AFAIK.

The query could look into the form directly; then, its SQL will look like

select * from yourtable where yourdate between
forms!yourform!yourcontrol and dateadd("m",-3,forms!yourform!yourcontrol)
--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Nov 12 '05 #2
On 3 Feb 2004 08:59:52 -0800, ji********@motorola.com (Jim) wrote:
I'm having a problem with a date query..im trying to pull customer
data based on a date specified from a form to 3 months prior to the
date specified. So lets say in the form I specified 1/2/2004. I
would need all records with a date in October '03, November '03,
December '03 and January '04. Every thing ive tried hasnt worked and
im getting all types of weird recordsets..

thanks

-Jim


As query criteria in the Date Field.

Between DateDiff("m",-3,forms!NameOfForm!NameOfControl) and
forms!NameOfForm!NameOfControl
--
Fred
Please respond only to this newsgroup.
I do not reply to personal email
Nov 12 '05 #3
Jim
fr***@example.invalid wrote in message news:<sb********************************@4ax.com>. ..
On 3 Feb 2004 08:59:52 -0800, ji********@motorola.com (Jim) wrote:
I'm having a problem with a date query..im trying to pull customer
data based on a date specified from a form to 3 months prior to the
date specified. So lets say in the form I specified 1/2/2004. I
would need all records with a date in October '03, November '03,
December '03 and January '04. Every thing ive tried hasnt worked and
im getting all types of weird recordsets..

thanks

-Jim


As query criteria in the Date Field.

Between DateDiff("m",-3,forms!NameOfForm!NameOfControl) and
forms!NameOfForm!NameOfControl


Ok but this query doesnt look like it will give me all the records in january..

-Jim
Nov 12 '05 #4

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

Similar topics

1
by: Raghu | last post by:
Hello... I am running into a problem while running a query..can some1 help.. this is the query : ************** SELECT * from Table S where S.dtDate1 BETWEEN...
3
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field...
8
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...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
14
by: marcokrechting | last post by:
Hi All, I have a rather complex math problem concerning dates. I will try to explain my problem. I have a table with the fields SUBJECT (text), DUE DATE (date) and CHECKED (yes/no). In this...
3
by: Andy_Khosravi | last post by:
I have been trying to build a user friendly search engine for a small database I have created. I'm having some particular problems with one of my date fields. Here's the setup: I'm using...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
5
by: ShadesOfGrey | last post by:
Hi, new to the group, not to Access...but it's been awhile since I've done much with it. I am creating a database that tracks student and instructor attendance. I have two tables, one for student...
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: 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
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...
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.