469,289 Members | 2,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

comparing dates

Hi peeps

I have an expiry date stored as a text field in the
following way "2003-08-23" (this gets round the US/UK
date prob)

The problem is I want to be able to show a Renew option
on the page FROM 30 days prior to that date. And then of
course if they don't renew, it unsubscribes them.

Question, how can I compare this date to see if todays
date is 30 days or closer to the expiry date?

Cheers
Dan
Jul 19 '05 #1
1 3042
Function CheckDaysToExpire(strDate,intThreshold)

CheckDaysToExpire = False

If Len(strDate) <> 10 Tnen

If Not IsNumeric(intThreshold) Then

intThreshold = 0

End If

dtmDate = DateSerial(Left(strDate,4),Mid(strData,6,2),Right( strData,2)

If DateDiff("d",dtmDate,Date) < CInt(intThreshold) Then

CheckDaysToExpire = True

End If

End If

End Function
-dlbjr

invariable unerring alien
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike N. | last post: by
2 posts views Thread by Duppypog | last post: by
2 posts views Thread by Philip Townsend | last post: by
2 posts views Thread by Manny Chohan | last post: by
2 posts views Thread by ameshkin | last post: by
12 posts views Thread by colincolehour | last post: by
4 posts views Thread by cheryl | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.