forms and queries

E

Erik P

I have a form that has 5 text boxes.
1) is the start date
2) is the ending date
3) is an expression:=Month([end_date])
4) is an expression:=Year([end_date])
5) is an expression: =[end_date_month] & "/" & "*" & "/" & [end_date_year]
ok. so on my query under the date field in the criteria i want the value
from the text box #5 on the form but i get and error message and can't figure
it out. I will try to explain what i am doing and maybe there is an easier
way to to this. Ok. On the form i would like to enter a start date and a
ending date. In the query I would like the date field to search forthe ending
date month. example: ending date on form is 3/3/08 I would like the criteria
in the query to show this like "3/*/08". I was tring to get this from the
expression in the text box #5 from the form. So i hope this makes sense an
any help would great. Thanks so much!
 
K

KARL DEWEY

Dates are stored as a decomal number and then formated for human viewing.
You can not use a wildcard in a date expression as there is no such numerical
equilivant.
What you need is ---
Between [start date] And [ending date]
 
E

Erik P

I have a access book that i am looking at and there is a expression that uses
the [like "1/*/08"] and it works fine in the query. It finds all the dates
for that month. I just don't want to type thosse in every time i wanted it to
take the ending date off the form and convert it to the previous expression.

KARL DEWEY said:
Dates are stored as a decomal number and then formated for human viewing.
You can not use a wildcard in a date expression as there is no such numerical
equilivant.
What you need is ---
Between [start date] And [ending date]

--
KARL DEWEY
Build a little - Test a little


Erik P said:
I have a form that has 5 text boxes.
1) is the start date
2) is the ending date
3) is an expression:=Month([end_date])
4) is an expression:=Year([end_date])
5) is an expression: =[end_date_month] & "/" & "*" & "/" & [end_date_year]
ok. so on my query under the date field in the criteria i want the value
from the text box #5 on the form but i get and error message and can't figure
it out. I will try to explain what i am doing and maybe there is an easier
way to to this. Ok. On the form i would like to enter a start date and a
ending date. In the query I would like the date field to search forthe ending
date month. example: ending date on form is 3/3/08 I would like the criteria
in the query to show this like "3/*/08". I was tring to get this from the
expression in the text box #5 from the form. So i hope this makes sense an
any help would great. Thanks so much!
 
K

KARL DEWEY

Try this as criteria --
Like Month([Forms]![YourFormName]![Ending Date TextBox]) & "/*/" &
Year([Forms]![YourFormName]![Ending Date TextBox])
The form must be open and have entry in [Ending Date TextBox] when the query
is run.
--
KARL DEWEY
Build a little - Test a little


Erik P said:
I have a access book that i am looking at and there is a expression that uses
the [like "1/*/08"] and it works fine in the query. It finds all the dates
for that month. I just don't want to type thosse in every time i wanted it to
take the ending date off the form and convert it to the previous expression.

KARL DEWEY said:
Dates are stored as a decomal number and then formated for human viewing.
You can not use a wildcard in a date expression as there is no such numerical
equilivant.
What you need is ---
Between [start date] And [ending date]

--
KARL DEWEY
Build a little - Test a little


Erik P said:
I have a form that has 5 text boxes.
1) is the start date
2) is the ending date
3) is an expression:=Month([end_date])
4) is an expression:=Year([end_date])
5) is an expression: =[end_date_month] & "/" & "*" & "/" & [end_date_year]
ok. so on my query under the date field in the criteria i want the value
from the text box #5 on the form but i get and error message and can't figure
it out. I will try to explain what i am doing and maybe there is an easier
way to to this. Ok. On the form i would like to enter a start date and a
ending date. In the query I would like the date field to search forthe ending
date month. example: ending date on form is 3/3/08 I would like the criteria
in the query to show this like "3/*/08". I was tring to get this from the
expression in the text box #5 from the form. So i hope this makes sense an
any help would great. Thanks so much!
 
R

raskew via AccessMonster.com

It appears you’re working with just one month, so you need just one text box
to enter mm/yyyy.
The datevalue() function will return the 1st day of the month, e.g.

X = “03/2008â€
Y = datevalue(x)
? y
03/01/2008
z = dateadd(“mâ€,1, y)
? z
04/01/2008
= y and <z
would return all the days in March 2008


KARL said:
Try this as criteria --
Like Month([Forms]![YourFormName]![Ending Date TextBox]) & "/*/" &
Year([Forms]![YourFormName]![Ending Date TextBox])
The form must be open and have entry in [Ending Date TextBox] when the query
is run.
I have a access book that i am looking at and there is a expression that uses
the [like "1/*/08"] and it works fine in the query. It finds all the dates
[quoted text clipped - 22 lines]
 

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