Parameter Query Not Working (1 Viewer)

bgcogen

Registered User.
Local time
Today, 05:03
Joined
Apr 19, 2002
Messages
61
Hi.
I have a query that is drawn from a master table. In the query there is a field for date. In the field for date I have it formatted as:

Date: Format([Time of fault],"Short Date")

Grand.

But when I put:
Between [Start Date dd-mm-yy] And [End Date dd-mm-yy]

into the creteria field to filter the query, it doesn't seem to work. When I run the query it includes records that are outside the bounds of my parameter!!

Does anyone have any ideas???

Thanks a million,
D
 

Sohaila Taravati

Registered User.
Local time
Today, 05:03
Joined
Oct 24, 2001
Messages
266
Because you are not putting in your field in the critaria! Do this instead:
Between [Time Of Fault] And [Time Of Fault] :)
 

dgoulston

Hasn't Got A Clue
Local time
Today, 05:03
Joined
Jun 10, 2002
Messages
403
#ok i believe u are trying to get records from a period specified..

#are you entering the dates, or do u want it to look them up, if
#so whhat are there field names.

#Sohaila Taravati im not too sure what u are doin, you have
#canceled the between statement. saying you want something
#between itself and itself. e.g. between 12/03/02 and 12/03/02


# if its 2 field names then its as easy as

Between [startdate] And [enddate]

# if u are entering the date then:


Between [01/01/02] And [02/02/02]

#depending on the dates.
#and if u want jus one date u put
"01/01/02"

#hope that helps
#DAL
 

bgcogen

Registered User.
Local time
Today, 05:03
Joined
Apr 19, 2002
Messages
61
Well, I just want the query to show all the records between the ones that the user entered at the prompt. It was my understang that what ever was between the brackets "Between [] And []" would appear on the message box to let the user know what to type.

The Master table contains hundreds of records, they all have a "Time_of_fault" field.

By putting "Between [Start Date dd-mm-yyyy] And [End Date dd-mm-yyyy]"

in the criteria section I want the query to just show the records that fall in between those dates. "Start Date" and "End Date" are only prompts that I use.

Anby ideas as to why it's showing records outside the given creteria, or do you know of any other solution.

Thanks for you help,
D
 

dgoulston

Hasn't Got A Clue
Local time
Today, 05:03
Joined
Jun 10, 2002
Messages
403
ok i understand now

i just tested it and seems to work fine on a test database i have, so im baffelled. if u can send me ur database and i will have a look for u, otherwise i have no other ideas.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:03
Joined
Feb 19, 2002
Messages
43,263
The problem is with SQL. It assumes that all text dates are in US date format - month, day, year. You need to convert your dates to US format or convert them to date/time data types. The following may do it for you but I haven't tested it so I'm not sure:

Between CDate([Start Date dd-mm-yy]) And CDate([End Date dd-mm-yy])
 

Users who are viewing this thread

Top Bottom