Home All Groups Group Topic Archive Search About

Difference between two dates in Weeks and Days



Author
28 Jun 2006 8:37 AM
David
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

Author
28 Jun 2006 9:05 AM
Evertjan.
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)
Author
29 Jun 2006 1:24 AM
Kyle Peterson
http://www.powerasp.com/content/new/function-reference-19.htm

Show quote
"David" <davidgor***@scene-double.co.uk> wrote in message
news:1151483825.708592.80430@m73g2000cwd.googlegroups.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
>

AddThis Social Bookmark Button