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

Difference between two dates in Weeks and Days

P: n/a
Hi,

I have an order processing system in which I have an OrderDate and a
Completion Date

I want to print the difference in Weeks and Days between the two dates,
i.e. if the completion date is 3 weeks and 2 days after the order date,
I want to print : 3 Weeks and 2 Days, on the page.
Is this possible ?

Appreciate your help
Thanks
David

Jun 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
David wrote on 28 jun 2006 in microsoft.public.inetserver.asp.general:
I have an order processing system in which I have an OrderDate and a
Completion Date

I want to print the difference in Weeks and Days between the two dates,
i.e. if the completion date is 3 weeks and 2 days after the order date,
I want to print : 3 Weeks and 2 Days, on the page.
Is this possible ?


Yes.
dif = DateDiff( "d", date1, date2 )

weeks = fix( dif / 7 )

restDays = abs( dif - ( weeks * 7 ) )

result = weeks & " weeks and " & restDays & " days."

[not tested]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 28 '06 #2

P: n/a

http://www.powerasp.com/content/new/...ference-19.htm

"David" <da*********@scene-double.co.uk> wrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Hi,

I have an order processing system in which I have an OrderDate and a
Completion Date

I want to print the difference in Weeks and Days between the two dates,
i.e. if the completion date is 3 weeks and 2 days after the order date,
I want to print : 3 Weeks and 2 Days, on the page.
Is this possible ?

Appreciate your help
Thanks
David

Jun 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.