By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,553 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,553 IT Pros & Developers. It's quick & easy.

Comparing of dates

P: 19
Dear sir,

1. Is there any function used to compare dates in the same way as strings are compared ?
As in : Date 1= 11/22/2006
Date 2= 11/23/2006
Nov 22 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 267
Dear sir,

1. Is there any function used to compare dates in the same way as strings are compared ?
As in : Date 1= 11/22/2006
Date 2= 11/23/2006
hi

if (string) "Date 1" (rather no space in variables) is "11/22/2006"
you can use this directly
Nov 22 '06 #2

100+
P: 267
hi

if (string) "Date 1" (rather no space in variables) is "11/22/2006"
you can use this directly
hi

2ndly you can use DateDiff

date0 = "12/03/2006"
date1 = Format(Date, "dd/mm/yyyy")
diff = DateDiff("d", date0, date1)
Nov 22 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.