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

Compare date difference in MS Access with ASP

P: 1
I need to create a page which takes input from a field from MS Access Database which has one date and there is another field in the MS Access Database which has another date.

I want to find the date difference in no of days from these two fields using ASP VBScript. Kindly Help me out.
Jun 24 '06 #1
Share this Question
Share on Google+
1 Reply


sashi
Expert 100+
P: 1,754
Hi there,

<%
date1 = dareRS.Fields("dtFirstDate")
date2 = dareRS.Fields("dtSecondDate")
%>

<%=DateDiff("m",date1,date2)%>


The "m" specifies month. Here are a complete list of the other options available.

Setting Description
yyyy - Year
q - Quarter
m - Month
y - Day of year
d - Day
w - Weekday
ww - Week of year
h - Hour
n - Minute
s - Second

good luck my fren..
Jun 27 '06 #2

Post your reply

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