472,353 Members | 1,654 Online

# Difference between two dates in Weeks and Days

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 ?

Thanks
David

Jun 28 '06 #1
2 4853
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.
Jun 28 '06 #2

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

"David" <da*********@scene-double.co.uk> wrote in message
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 ?

Thanks
David

Jun 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

### Similar topics

 26 by: Frank | last post by: For my website i would like to display the age of my son in years, months, days and hours. For now i manage to get a result for totals. Like the... 8 by: Mojca | last post by: What is formula that get days between two dates? Npr: 11.03.1998 – 1.7.2005 Thank you, Mojca 1 by: Alicia | last post by: I basically wanted something that would do a count of the dates, then group them by their week name.. BEFORE: Resource Date Total... 36 by: Lindie | last post by: The more I read the more confused I get. Too much on dates calulations in the groups. I need to know how often a book has been loaned out over... 6 by: Ashish Sheth | last post by: Hi All, In C#, How can I get the difference between two dates in number of months? I tried to use the Substract method of the DateTime class and it... 3 by: weche | last post by: I would like to know how I can calculate the diference in time between 2 dates. I would input a date (before the current date) and the code would... 4 by: jamesyreid | last post by: Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone... 3 by: Patonar | last post by: Hi, I have a query which works out which orders are due to be delivered in a particular week. I would like to display this by week commencing... 8 by: Claudia Fong | last post by: Hi, In VB we have DateDiff to calculate the days difference between 2 dates, I was wondering if we have something like that in C#? I want... 0 by: Naresh1 | last post by: What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge... 0 by: antdb | last post by: Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was... 0 by: Matthew3360 | last post by: Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ... 2 by: Matthew3360 | last post by: Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it... 0 by: Arjunsri | last post by: I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and... 0 by: Matthew3360 | last post by: Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web... 0 by: Oralloy | last post by: Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the... 0 by: Carina712 | last post by: Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand.... 0 by: BLUEPANDA | last post by: At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...