HELP - record keeping duplicating in other queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that I use to keep track of people in my office that I
provide help to. Each month I create a new query for the month we are in to
add new entries for the month. I created my July query like I have in the
previous months and added my first entry. It keeps adding my July entry to
the June query. I looked at my query in design view and it's based off my
table and in the date field it's critera is set up as >6/30/2006 so it will
not hold any entries from previous months. This is how I have been doing
this for a year and have never had this type of problem. Any help would be
appreciated
 
I've tried that and it doesn't work, it will not keep the entry since it is
looking for June 30. The reason I set it as >6/30/06 is because nothing will
show up which is what I want so I can entry my July information. It still
saves my entry in the June query and form. I don't understand why this is
happening now and it never has before.
 
No worries - there is always something your can try (well most the times)

Try this

June
USA >#06/01/2006# and <#30/06/2006#
UK >#01/06/2006# and <#30/06/2006#


July
USA >#07/01/2006# and <#31/07/2006#
UK >#01/07/2006# and <#31/07/2006#


August
USA >#08/01/2006# and <#08/31/2006#
UK >#01/08/2006# and <#31/08/2006#

Etc, etc

If this doesn't work can you post the sql of the query
 
If you only want to see this months stuff try this - like I said there is
normally something else you can try

Year([SandiesWorkField]) = Year(Now()) And Month([SandiesWorkField]) =
Month(Now())

Note, you "should" use the Year as this way you won't have to change the
criteria each year (unless you want to see "each" june, july, aug, for
"every" year since you started your DB)


Or you can use the sql

SELECT TableName.PirmaryKey, TableName.SandiesJobStuff,
TableName.SandiesWorkField, etc, etc, etc
FROM TableName
WHERE (((Format([SandiesWorkField],"myyyy"))=Month(Date()) & Year(Date())));

Obviously change the names to what you would normally
 
I have a database that I use to keep track of people in my office that I
provide help to. Each month I create a new query for the month we are in to
add new entries for the month. I created my July query like I have in the
previous months and added my first entry. It keeps adding my July entry to
the June query. I looked at my query in design view and it's based off my
table and in the date field it's critera is set up as >6/30/2006 so it will
not hold any entries from previous months. This is how I have been doing
this for a year and have never had this type of problem. Any help would be
appreciated

Rather than creating multiple queries to do the same job, might it not
be simpler to use one parameter query? For the current month you could
use a criterion
= DateSerial(Year(Date()), Month(Date()), 1)

Your criterion for the June query will indeed return all dates in July
- you're asking for all dates AFTER June 30. It sounds like it's doing
precisely what you ask it to do. If you want to include only dates in
June, and exclude earlier and later dates, the correct criterion would
be either
= #6/1/2006# AND < #7/1/2006#

or (more flexibly)
= DateSerial([Enter year:], [Enter month number:], 1) AND < DateSerial([Enter year:], [Enter month number:] + 1, 1)

John W. Vinson[MVP]
 
Back
Top