No results using DateDiff

  • Thread starter Thread starter Martha
  • Start date Start date
M

Martha

I am working with DateDiff . I get no error messages but also do not get any
results in my calculated field. I have two dates, START_DATE and END_DATE and
I need to know the number of days between them. START_DATE and END_DATE are
both Date/Time type with a Short Date format.

I am working in the QBE grid to write the query. I select an empty column
and put my DateDiff calculation on the line below Or: in the Criteria area. I
have tried:

[END_DATE]-[START_DATE]
and
DateDiff("d",[START_DATE],[STOP_DATE])

Both approaches ask for parameter values for Time and STOP_DATE. If I don't
enter anything the query runs and displays data from all other columns,
displays the calculated field, Time, but the cells are empty.

Help is appreciated, and I expect to feel pretty stupid after I get it!
 
Martha

Is there any significance to your use of both [END_DATE] and [STOP_DATE]?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Create a calculated field in your query:

TotDays: DateDiff("d",[START_DATE], [END_DATE])

Not in the criteria rows.
 
Thanks, Klatuu. As this is my first post, could you let me know how to mark
this thread as answered?

Martha

Klatuu said:
Create a calculated field in your query:

TotDays: DateDiff("d",[START_DATE], [END_DATE])

Not in the criteria rows.
--
Dave Hargis, Microsoft Access MVP


Martha said:
I am working with DateDiff . I get no error messages but also do not get any
results in my calculated field. I have two dates, START_DATE and END_DATE and
I need to know the number of days between them. START_DATE and END_DATE are
both Date/Time type with a Short Date format.

I am working in the QBE grid to write the query. I select an empty column
and put my DateDiff calculation on the line below Or: in the Criteria area. I
have tried:

[END_DATE]-[START_DATE]
and
DateDiff("d",[START_DATE],[STOP_DATE])

Both approaches ask for parameter values for Time and STOP_DATE. If I don't
enter anything the query runs and displays data from all other columns,
displays the calculated field, Time, but the cells are empty.

Help is appreciated, and I expect to feel pretty stupid after I get it!
 
It is enough, already, that you simply mentioned it ! You would be
surprised to see how many posters don't even take time to give even that
kind of simple feed-back ! Thanks to you to do it.


Vanderghast, Access MVP
 
Jeff,
No significance except to demonstrate that my head is not always directing
my fingers. They should have been the same.
Martha

Jeff Boyce said:
Martha

Is there any significance to your use of both [END_DATE] and [STOP_DATE]?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Martha said:
I am working with DateDiff . I get no error messages but also do not get
any
results in my calculated field. I have two dates, START_DATE and END_DATE
and
I need to know the number of days between them. START_DATE and END_DATE
are
both Date/Time type with a Short Date format.

I am working in the QBE grid to write the query. I select an empty column
and put my DateDiff calculation on the line below Or: in the Criteria
area. I
have tried:

[END_DATE]-[START_DATE]
and
DateDiff("d",[START_DATE],[STOP_DATE])

Both approaches ask for parameter values for Time and STOP_DATE. If I
don't
enter anything the query runs and displays data from all other columns,
displays the calculated field, Time, but the cells are empty.

Help is appreciated, and I expect to feel pretty stupid after I get it!
 

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

Back
Top