query

pcastner1

Registered User.
Local time
Yesterday, 16:27
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.
 
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.
 
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.
 
...Where [dateFld] between [start date] and [end date]
 
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:
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?
 
Certainly.

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

Users who are viewing this thread

Back
Top Bottom