Normal Topic Counting Days (Read 514 times)
Robert
Member
*
Offline



Posts: 35
Joined: May 7th, 2013
Counting Days
Sep 24th, 2014 at 4:17pm
Print Post Print Post  
I need to get a total number of days between any two given dates.  Not worried about holidays, weekends, etc.  Right now when I subtract one date field from another I get a date result rather than just an integer.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Counting Days
Reply #1 - Sep 24th, 2014 at 9:14pm
Print Post Print Post  
Is the result variable an integer or a date?

It should be an integer:

Code
Select All
var aa as int

aa = date1 - date2
 



and displayed in a numeric, rather than date, element.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Counting Days
Reply #2 - Sep 30th, 2014 at 8:44pm
Print Post Print Post  
You may also need to force a type conversion:

Code
Select All
var aa as int

aa = @ToNumber(date1) - @ToNumber(date2) 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged