Ok. I have a form with a text box and button, the textbox take a text value
which represents the number of day. I have a table and one of the columns is
named DateCreated, I would like to take the number entered in the text box
and subtract it from a short date in a query, and return all records that
were created n days ago, currently i have this in the criteria column of the
query.
=< -10
I thought this would return all records created 10 days ago. Do i have to
convert the value i recieved in the textbox to date format.
sheniece - 12 Nov 2007 00:53 GMT
Ok. I figured it out.
>=DateAdd("d",-([Forms]![frmName]![tbxDays]),Date())
>Ok. I have a form with a text box and button, the textbox take a text value
>which represents the number of day. I have a table and one of the columns is
[quoted text clipped - 7 lines]
>I thought this would return all records created 10 days ago. Do i have to
>convert the value i recieved in the textbox to date format.
Marshall Barton - 12 Nov 2007 01:10 GMT
>Ok. I have a form with a text box and button, the textbox take a text value
>which represents the number of day. I have a table and one of the columns is
[quoted text clipped - 7 lines]
>I thought this would return all records created 10 days ago. Do i have to
>convert the value i recieved in the textbox to date format.
Comparuing a date value to a number is meaningless. Use the
date manipulation function to operate on date values:
<= DateAdd("d", -Forms!theform.thetextbox, theshortdate)

Signature
Marsh
MVP [MS Access]