2 values in criteria question...........

S

sbshelp

hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
O

Ofer

I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense
 
S

sbshelp

thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


Ofer said:
I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



sbshelp said:
hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
O

Ofer

Then you can use the second example and change the second table name

Select * From TableName Where [date ordered] Between
DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



sbshelp said:
thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


Ofer said:
I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



sbshelp said:
hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
S

sbshelp

ofer - thaks man. shall i use this code in the build expression area of query?


Ofer said:
Then you can use the second example and change the second table name

Select * From TableName Where [date ordered] Between
DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



sbshelp said:
thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


Ofer said:
I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
O

Ofer

You can if you want to, I would create a new query, on the buttom of the
field [date ordered] where it say criteria, I would add this

Between DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

Just change the name of the table and fields, to your tables name



sbshelp said:
ofer - thaks man. shall i use this code in the build expression area of query?


Ofer said:
Then you can use the second example and change the second table name

Select * From TableName Where [date ordered] Between
DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



sbshelp said:
thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


:

I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
S

sbshelp

ofer - i think you are awesome. it works - thanks so much man.
you saved me.


Ofer said:
You can if you want to, I would create a new query, on the buttom of the
field [date ordered] where it say criteria, I would add this

Between DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

Just change the name of the table and fields, to your tables name



sbshelp said:
ofer - thaks man. shall i use this code in the build expression area of query?


Ofer said:
Then you can use the second example and change the second table name

Select * From TableName Where [date ordered] Between
DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


:

I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
O

Ofer

Your welcome, Glad I could help


sbshelp said:
ofer - i think you are awesome. it works - thanks so much man.
you saved me.


Ofer said:
You can if you want to, I would create a new query, on the buttom of the
field [date ordered] where it say criteria, I would add this

Between DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

Just change the name of the table and fields, to your tables name



sbshelp said:
ofer - thaks man. shall i use this code in the build expression area of query?


:

Then you can use the second example and change the second table name

Select * From TableName Where [date ordered] Between
DLookUp("DateFieldName","Table1Name") And
DLookUp("DateFieldName","Table2Name")

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

thanks so much man. i do have two separate date tables. i think that is
easier for me now? maybe?! :)

i just need to get those values into the criteria section of the query....
i may start all over and try your way?

thanks a ton.


:

I should have asked you tis question before, if you are using this date just
one time after the user enter the date, then you don't need to use tables,
create a form with two dates, that are not bound to a table, and then the
query will look up this fields in the form

Select * From TableName Where [date ordered] Between
Forms![FormName]![StartDateFieldName] And Forms![FormName]![EndDateFieldName]

If you want to use this date also after the form is close, then you can
create only one table that will hold the two dates, so you wont need to
forms, in one form the user will update the two fields, and then the query
can look like this

Select * From TableName Where [date ordered] Between
DLookkUp("StartDateFieldName","TableName") And
DLookkUp("EndDateFieldName","TableName")

I hope that make sense

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

hello - i have two tables each with a date in them. i am creating a query
that uses those two dates as criteria on a feild called "date ordered".

how do i use the values of tables in that criteria field? thanks!
 
Top