Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Finding the amount of days between two dates.

Greetings, I'm sure the solution to this, is easier than I think, but for the
life of me I can't figure this out.

I have two variables of data type Date.

DateFrom
DateTo

I'm attempting to get it so I can work out how many days there are between
these two dates.

DateFrom = 01/04/08
DateTo = 04/04/08
The Result should be 4.

I was thinking just grab the Day from the date and that'd be easy, but the
problem arises when you have dates that span a few months in distance.

Thank you for any help thrown in this general direction :) .
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Finding the amount of days between two dates.

Maybe

datefrom = #4/1/2008#
dateto = #4/4/2008#
diffference = dateto - datefrom + 1

Mike

"NateBuckley" wrote:

Greetings, I'm sure the solution to this, is easier than I think, but for the
life of me I can't figure this out.

I have two variables of data type Date.

DateFrom
DateTo

I'm attempting to get it so I can work out how many days there are between
these two dates.

DateFrom = 01/04/08
DateTo = 04/04/08
The Result should be 4.

I was thinking just grab the Day from the date and that'd be easy, but the
problem arises when you have dates that span a few months in distance.

Thank you for any help thrown in this general direction :) .

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Finding the amount of days between two dates.

What does the hash character mean?

And That worked great cheers :)

"Mike H" wrote:

Maybe

datefrom = #4/1/2008#
dateto = #4/4/2008#
diffference = dateto - datefrom + 1

Mike

"NateBuckley" wrote:

Greetings, I'm sure the solution to this, is easier than I think, but for the
life of me I can't figure this out.

I have two variables of data type Date.

DateFrom
DateTo

I'm attempting to get it so I can work out how many days there are between
these two dates.

DateFrom = 01/04/08
DateTo = 04/04/08
The Result should be 4.

I was thinking just grab the Day from the date and that'd be easy, but the
problem arises when you have dates that span a few months in distance.

Thank you for any help thrown in this general direction :) .

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Finding the amount of days between two dates.

It's part of the syntax for formatting a user date in VB

"NateBuckley" wrote:

What does the hash character mean?

And That worked great cheers :)

"Mike H" wrote:

Maybe

datefrom = #4/1/2008#
dateto = #4/4/2008#
diffference = dateto - datefrom + 1

Mike

"NateBuckley" wrote:

Greetings, I'm sure the solution to this, is easier than I think, but for the
life of me I can't figure this out.

I have two variables of data type Date.

DateFrom
DateTo

I'm attempting to get it so I can work out how many days there are between
these two dates.

DateFrom = 01/04/08
DateTo = 04/04/08
The Result should be 4.

I was thinking just grab the Day from the date and that'd be easy, but the
problem arises when you have dates that span a few months in distance.

Thank you for any help thrown in this general direction :) .

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum amount of days in another coloumn Scott_goddard Excel Worksheet Functions 8 April 13th 10 12:51 PM
Calc days between two dates and exclude leap year days scoz Excel Worksheet Functions 5 November 23rd 07 03:58 PM
Conditional Formatting Dates calculating 10 days and 30 days from a certain date Sioux[_2_] Excel Worksheet Functions 2 October 11th 07 02:04 PM
set a warning in excel after a certain amount of days George Excel Discussion (Misc queries) 3 August 29th 06 01:05 AM
Calculating # of busn days, not just calendar days, between 2 dates? StargateFanFromWork Excel Programming 1 June 29th 04 08:31 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"