A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DateDiff and Count/Sum



 
 
Thread Tools Display Modes
  #1  
Old April 14th, 2010, 08:52 PM posted to microsoft.public.access.reports
caro
external usenet poster
 
Posts: 15
Default DateDiff and Count/Sum

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro
  #2  
Old April 14th, 2010, 09:04 PM posted to microsoft.public.access.reports
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default DateDiff and Count/Sum

Where are you doing this? In a query?

Could you use a query, include the [Date of Awareness] field, and in the
criteria, use something like (untested):

Date()


Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"caro" wrote in message
...
I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in
the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro



  #3  
Old April 14th, 2010, 10:52 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default DateDiff and Count/Sum

What was the result for
=Abs(Sum([Date of Awareness] Date()))
Where did you enter this? What section of the report?

--
Duane Hookom
Microsoft Access MVP


"caro" wrote:

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro

  #4  
Old April 15th, 2010, 12:20 AM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default DateDiff and Count/Sum

Your =IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
has closing parenthesis misplaced like this --
=IIF(DateDiff("d", [Date of Awareness], Date())1,1,0)

Your =Abs(Sum([Date of Awareness] Date()))
is missing an IIF like this --
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))
and it does not need the Abs function.

--
Build a little, test a little.


"caro" wrote:

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro

  #5  
Old April 15th, 2010, 04:04 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default DateDiff and Count/Sum

Karl,
Aren't these the same:
=Abs(Sum([Date of Awareness] Date()))
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))

This expression will return -1 for true or 0 for false
[Date of Awareness] Date()

If you Sum() this expression, it will return a negative count of the number
of records that return true.

Changing the negative to positive with Abs() should provide the same value
as your suggestion. Or, did I miss something?

--
Duane Hookom
Microsoft Access MVP


"KARL DEWEY" wrote:

Your =IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
has closing parenthesis misplaced like this --
=IIF(DateDiff("d", [Date of Awareness], Date())1,1,0)

Your =Abs(Sum([Date of Awareness] Date()))
is missing an IIF like this --
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))
and it does not need the Abs function.

--
Build a little, test a little.


"caro" wrote:

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro

  #6  
Old April 15th, 2010, 05:31 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default DateDiff and Count/Sum

You did not miss anything, I just do not know a lot of things.
--
Build a little, test a little.


"Duane Hookom" wrote:

Karl,
Aren't these the same:
=Abs(Sum([Date of Awareness] Date()))
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))

This expression will return -1 for true or 0 for false
[Date of Awareness] Date()

If you Sum() this expression, it will return a negative count of the number
of records that return true.

Changing the negative to positive with Abs() should provide the same value
as your suggestion. Or, did I miss something?

--
Duane Hookom
Microsoft Access MVP


"KARL DEWEY" wrote:

Your =IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
has closing parenthesis misplaced like this --
=IIF(DateDiff("d", [Date of Awareness], Date())1,1,0)

Your =Abs(Sum([Date of Awareness] Date()))
is missing an IIF like this --
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))
and it does not need the Abs function.

--
Build a little, test a little.


"caro" wrote:

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro

  #7  
Old April 15th, 2010, 06:53 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default DateDiff and Count/Sum

Karl,
I have learned a lot from your past posts so I was a bit concerned I had
messed up the syntax/expression.

--
Duane Hookom
Microsoft Access MVP


"KARL DEWEY" wrote:

You did not miss anything, I just do not know a lot of things.
--
Build a little, test a little.


"Duane Hookom" wrote:

Karl,
Aren't these the same:
=Abs(Sum([Date of Awareness] Date()))
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))

This expression will return -1 for true or 0 for false
[Date of Awareness] Date()

If you Sum() this expression, it will return a negative count of the number
of records that return true.

Changing the negative to positive with Abs() should provide the same value
as your suggestion. Or, did I miss something?

--
Duane Hookom
Microsoft Access MVP


"KARL DEWEY" wrote:

Your =IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
has closing parenthesis misplaced like this --
=IIF(DateDiff("d", [Date of Awareness], Date())1,1,0)

Your =Abs(Sum([Date of Awareness] Date()))
is missing an IIF like this --
=Abs(Sum(IIF([Date of Awareness] Date(), 1, 0)))
and it does not need the Abs function.

--
Build a little, test a little.


"caro" wrote:

I am trying to count records where the scheduled date is greater than the
current date. All Dates (past visits and scheduled visits) are listed in the
Date of Awareness field. The expressions I have tried include:
=IIF(DateDiff("d", [Date of Awareness], Date()1,1,0))
=Abs(Sum([Date of Awareness] Date()))
Please let me know if I am even on the right track.
-Caro

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.