query (1 Viewer)

pcastner1

Registered User.
Local time
Today, 08:44
Joined
Dec 29, 2018
Messages
19
I have a query to find an employee and the month my query has this for the date>=[Start Date] And <=[End Date] and my employe has [Enter Name]. Everything works until the report. it shows all the months not just one. So if they select the month of Feb they also Jan.
 

June7

AWF VIP
Local time
Today, 07:44
Joined
Mar 9, 2014
Messages
5,492
Date >= [Start Date] AND Date <= [End Date]

or

Date BETWEEN [Start Date] AND [End Date]

But neither will work if the input is only the month. Users are inputting full date?

Advise not to use popup input prompt - cannot validate user input. Should reference form controls for user input.
 

Micron

AWF VIP
Local time
Today, 11:44
Joined
Oct 20, 2018
Messages
3,478
whenever you have a comparison like this, split it into two separate parts/sentences/thoughts until you get the hang of it, because this is the way it will be compared:
sentence 1 - date>=[Start Date].

sentence 2: And<=[End Date]
Does the second part make sense? I hope not. Try

date >= [Start Date] And date <= [End Date]
I hope date isn't the name of your control or field.
 

Ranman256

Well-known member
Local time
Today, 11:44
Joined
Apr 9, 2015
Messages
4,337
...Where [dateFld] between [start date] and [end date]
 

George21

Registered User.
Local time
Today, 18:44
Joined
Jan 10, 2011
Messages
26
Are [Start Date] and [End Date] message boxes? If so try:

>=Format([Start Date],"mm/dd/yyyy") And <=Format([End Date],"mm/dd/yyyy")

Sent from my SM-T825 using Tapatalk
 
Last edited:

pcastner1

Registered User.
Local time
Today, 08:44
Joined
Dec 29, 2018
Messages
19
I tried the criteria above but still get more than one month. I put a [startdate] and [enddate] but didn't work. Can I query the start and end date to just show a certain month?
 

June7

AWF VIP
Local time
Today, 07:44
Joined
Mar 9, 2014
Messages
5,492
Certainly.

If you want to provide db for analysis, follow instructions at bottom of my post.
 

Users who are viewing this thread

Top Bottom