John,
That's a good question. Guess I would have to test it out and see what the
results look like. First off though, were I to use the approach you
submitted as an interpretation of what MSDN say's about DateDiff I foresee
the need to have to use other functions to slice and dice the dates to get
the ##/## or #/# part of the date before I could have anything useful. The
second task would be how to use it in a query.
Honestly John, this stuff is way over my head. I have switched dates around,
used ABS(), everything I can think of and stuff others have suggested. Just
when I think I have it all solved a new problem creeps into the picture. You
folks are fantastic though because you don't give up. That's why I haven't
thrown in the towel myself. I'll keep at it John thanks to you and all the
others who have contributed.
KP
"John W. Vinson" wrote:
> On Fri, 5 Jun 2009 18:17:01 -0700, Keypad <(E-Mail Removed)>
> wrote:
>
> >If date1 or date2 is a date literal, the specified year becomes a permanent
> >part of that date. However, if date1 or date2 is enclosed in double quotation
> >marks (" "), and you omit the year, the current year is inserted in your code
> >each time the date1 or date2 expression is evaluated. This makes it possible
> >to write code that can be used in different years.)
> >
> >So, based on the explanation above the first part would explain why I get
> >the negative numbers. The second part looks like what to do when dealing
> >with expiration dates of different years. Trouble is, does anyone know how
> >to code something like what's being described in the second part.
>
> Ummmmm...
>
> DateDiff("d", "6/4", [datefield])
>
> will get the number of days between 6/4/2009 until the value in datefield, if
> it's run during 2009. If it's run in 2010, it will get the days between
> 6/4/2010 and the value in datefield.
>
> Is that what you mean by "the second part"???
> --
>
> John W. Vinson [MVP]
>
|