need to create a parameter query that will show the records betwee

M

mrbeepa

I am trying to create a query that will show the records that have an install
date between the dates a user inputs. I have a contract table with a date
field called installDate when I tried a simple parameter query: The code I
put in the crieteria row is this ->>> Between [Enter Date] and [Enter Date]
->>>so that the user will be prompted to enter the dates that the user is
seeking to find the installs between those dates? But what happens is I get
the first prompt and not the second and the query fails to find any records.
(of course!)

also, it would make it simpler for me if I could refer to the weeks as 1 -
52 is there a simple way to do that, or even a built in function that returns
the week as a number? Then I could just have the user input a week number?

any help would be appreciated :)
 
L

Lord Kelvan

heh thats because you are using the same variable try Between [Enter
Start Date] and [Enter End Date]
 
K

KARL DEWEY

Use this for criteria --
Between [Enter Start Date] and [Enter End Date]
When they are identical you will get only one prompt and it would be same as
=[Enter Date].

Format([YourDate],"ww") will give you the week number of the year.
Remember that every year has a week one.
 
M

mrbeepa

Thank you both for your info, as you can see I'm pretty raw at this! Preciate
the help greatly!

KARL DEWEY said:
Use this for criteria --
Between [Enter Start Date] and [Enter End Date]
When they are identical you will get only one prompt and it would be same as
=[Enter Date].

Format([YourDate],"ww") will give you the week number of the year.
Remember that every year has a week one.

--
KARL DEWEY
Build a little - Test a little


mrbeepa said:
I am trying to create a query that will show the records that have an install
date between the dates a user inputs. I have a contract table with a date
field called installDate when I tried a simple parameter query: The code I
put in the crieteria row is this ->>> Between [Enter Date] and [Enter Date]
->>>so that the user will be prompted to enter the dates that the user is
seeking to find the installs between those dates? But what happens is I get
the first prompt and not the second and the query fails to find any records.
(of course!)

also, it would make it simpler for me if I could refer to the weeks as 1 -
52 is there a simple way to do that, or even a built in function that returns
the week as a number? Then I could just have the user input a week number?

any help would be appreciated :)
 
M

mrbeepa

If you still are viewing this thread I just was trying to format the date as
you said, do I need to keep the data type as a date? Or do I change it to a
number?

KARL DEWEY said:
Use this for criteria --
Between [Enter Start Date] and [Enter End Date]
When they are identical you will get only one prompt and it would be same as
=[Enter Date].

Format([YourDate],"ww") will give you the week number of the year.
Remember that every year has a week one.

--
KARL DEWEY
Build a little - Test a little


mrbeepa said:
I am trying to create a query that will show the records that have an install
date between the dates a user inputs. I have a contract table with a date
field called installDate when I tried a simple parameter query: The code I
put in the crieteria row is this ->>> Between [Enter Date] and [Enter Date]
->>>so that the user will be prompted to enter the dates that the user is
seeking to find the installs between those dates? But what happens is I get
the first prompt and not the second and the query fails to find any records.
(of course!)

also, it would make it simpler for me if I could refer to the weeks as 1 -
52 is there a simple way to do that, or even a built in function that returns
the week as a number? Then I could just have the user input a week number?

any help would be appreciated :)
 
K

KARL DEWEY

Keep it as a DateTime datatype.
--
KARL DEWEY
Build a little - Test a little


mrbeepa said:
If you still are viewing this thread I just was trying to format the date as
you said, do I need to keep the data type as a date? Or do I change it to a
number?

KARL DEWEY said:
Use this for criteria --
Between [Enter Start Date] and [Enter End Date]
When they are identical you will get only one prompt and it would be same as
=[Enter Date].

Format([YourDate],"ww") will give you the week number of the year.
Remember that every year has a week one.

--
KARL DEWEY
Build a little - Test a little


mrbeepa said:
I am trying to create a query that will show the records that have an install
date between the dates a user inputs. I have a contract table with a date
field called installDate when I tried a simple parameter query: The code I
put in the crieteria row is this ->>> Between [Enter Date] and [Enter Date]
->>>so that the user will be prompted to enter the dates that the user is
seeking to find the installs between those dates? But what happens is I get
the first prompt and not the second and the query fails to find any records.
(of course!)

also, it would make it simpler for me if I could refer to the weeks as 1 -
52 is there a simple way to do that, or even a built in function that returns
the week as a number? Then I could just have the user input a week number?

any help would be appreciated :)
 
L

Lord Kelvan

for what you want you will need to create and expression that is
Format([YourDate],"ww") and then make the criteria for that expression
Between [Enter Start week] and [Enter End week]

so in the design view in the field box type
myweek:Format([YourDate],"ww")
[YourDate] being the field that contains your date

and in the criteria for that field type Between [Enter Start week] and
[Enter End week]

you may also want to click the check box for that field to hide it as
you dont want to display that information just query on it

i hope this helps

Kelvan McEwen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top