This is actually pretty straightforward but it took me a few minutes to figure it out. This was to check if a dog was 6 months old or so... I padded it a bit, becasue if the dog was "too old," it would prevent a user from continuing. I figured give them a bit more than 6 months, hence 195 days.
DateDiff is a function that returns the difference between two dates.
Dogs.birthday is a date, Dogs.name is text, from a db query (duh, huh?).
<CFIF ( DateDiff("d", Now(), Dogs.birthday ) ) GT 195 >
Older than 6 months ( #DateDiff("d", Now(), Dogs.birthday )# days)
Younger than 6 months ( #DateDiff("d", Now(), Dogs.birthday )# days)
More info on DateDiffPosted by illovich at March 06, 2004 05:39 PM