From: caro on 14 Apr 2010 15:52 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
From: Jeff Boyce on 14 Apr 2010 16:04 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" <caro(a)discussions.microsoft.com> wrote in message news:331E73B1-84FD-40F1-9DA3-0799825FDEC8(a)microsoft.com... >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
From: Duane Hookom on 14 Apr 2010 17:52 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
From: KARL DEWEY on 14 Apr 2010 19:20 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
From: Duane Hookom on 15 Apr 2010 11:04
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 |