G
Guest
I posted to the thread I made yesterday with same subject but not sure if you
guys look back. Duane and Seth, thank you for responding so promply
yesterday. appologies for taking so long to get back here.
I tried both your examples and have read just about every thread regarding
this. There must be something that I am not aware of.
Therefore I started over and made the simplest table starting from a fresh
new db with only one table without changing any of the defaults that Access
makes when building a table in design view as follows:
tbl: CHOCOMADE
fields: Date1; Milk; Dark; Vanilla; Daysince
I entered some dates (no nulls) into Date1 and some data into Milk; Dark;
Vanilla; fields and left the field Daysince empty.
I made ChocoQuery, drag each field to the query in design view as Seth
pointed out, then entered in Daysince criteria: Date()-[Date1] but nothing
shows.
I tried Duanes example doing the same procedure as above using
DateDiff("d",[Date1], Date()) in Daysince field and still nothing.
Note if I remove the criteria expression from the Datesince in the
ChocoQuery I can then see the data...
I hope I have articulated this well enough... as I said this seems to easy
to be so difficult I'll be watching all day for replies and correspondance.
Thanks again, Do please help
Luke
guys look back. Duane and Seth, thank you for responding so promply
yesterday. appologies for taking so long to get back here.
I tried both your examples and have read just about every thread regarding
this. There must be something that I am not aware of.
Therefore I started over and made the simplest table starting from a fresh
new db with only one table without changing any of the defaults that Access
makes when building a table in design view as follows:
tbl: CHOCOMADE
fields: Date1; Milk; Dark; Vanilla; Daysince
I entered some dates (no nulls) into Date1 and some data into Milk; Dark;
Vanilla; fields and left the field Daysince empty.
I made ChocoQuery, drag each field to the query in design view as Seth
pointed out, then entered in Daysince criteria: Date()-[Date1] but nothing
shows.
I tried Duanes example doing the same procedure as above using
DateDiff("d",[Date1], Date()) in Daysince field and still nothing.
Note if I remove the criteria expression from the Datesince in the
ChocoQuery I can then see the data...
I hope I have articulated this well enough... as I said this seems to easy
to be so difficult I'll be watching all day for replies and correspondance.
Thanks again, Do please help
Luke
Duane Hookom said:This should work:
DateDiff("d",[Date1], Date())
This assumes there are no Null values in the Date1 field.
--
Duane Hookom
MS Access MVP
Luke said:This seems basic... my Access 2002 tables has date1 field as well as other
field with vital information.
I want a new field to display the difference (Days) between date1 and the
current date without having to change the date every day
I have made a query using the different table fields and included "date1"
but not sure if I add a blank field in the table with a new named
"Daysince"
so that in the query, the "Daysince" field gets automatically filled in or
if
there is something else to do that I don't grasp about this.
I have tried datediff("d",now(),[date1]) and some other variations similar
but nothing shows or I get syntax error.
I hope I have offered enough information. Thank you for you assistance
Luke