CSI Report post Posted 09/09/2004 07:14 PM I have tried everything I can think of to get DateDiff to work. Here is the excerpt from the .vgl log. I am trying to calculate an age (in years) based on caller's input and the current day. {DateDiff("yyyy",01/01/1976, 09/09/2004)}[Eval Age]{0}[Age]{0} I have been to the Microsoft scripting web page that explains how to use this function, but it just doesn't seem to be working because I always get an age of zero... Share this post Link to post
SupportTeam Report post Posted 09/09/2004 08:37 PM Please post your script here and indicate in which module the DateDiff function is called, we can then have a look at it. Share this post Link to post
CSI Report post Posted 09/10/2004 05:16 PM It took some some trial and error, but I did figure it out. You need to encpsulate the date within quotes. DateDiff("yyyy", "01/01/1976", "09/09/2004") But I ended up not even using this method because the result isn't accurate to the day, just the year. It's really only evaluating 2004-1976 = 28. For this application, I needed to be accurate to the day. My real goal is to determine whether the caller is at least 21. So I used: DateAdd("yyyy", 21, "01/01/1976") <= "$RV_MM/$RV_DD/$RV_YEAR" It seems to work much better this way. Thanks for your help! Share this post Link to post