Need Days from two Dates
Moderators: chulett, rschirm, roy
Need Days from two Dates
Hi
I am trying to get no. of days from two dates.
Source dates
Date1 Date2
10/23/2010 10/25/2010
10/20/2010 10/22/2010
10/19/2010 10/22/2010
Read as varchars and converted to date format using stringtodate func.
Now Date1 and Date2 are date datatypes
Date1 Date2
2010-10-23 2010-10-25
2010-10-20 2010-10-22
2010-10-19 2010-10-22
Now in transformer
if i do
Date1-Date2 to get no. of days
output is Integer
I am getting an error
Invalid consertion from date to dfloat
any suggestion is greatly appreciated
Thanks in advance
Kris
I am trying to get no. of days from two dates.
Source dates
Date1 Date2
10/23/2010 10/25/2010
10/20/2010 10/22/2010
10/19/2010 10/22/2010
Read as varchars and converted to date format using stringtodate func.
Now Date1 and Date2 are date datatypes
Date1 Date2
2010-10-23 2010-10-25
2010-10-20 2010-10-22
2010-10-19 2010-10-22
Now in transformer
if i do
Date1-Date2 to get no. of days
output is Integer
I am getting an error
Invalid consertion from date to dfloat
any suggestion is greatly appreciated
Thanks in advance
Kris
-
- Participant
- Posts: 135
- Joined: Tue Aug 14, 2007 4:27 am
- Location: Mumbai
Re: Need Days from two Dates
plz try below function
DaysSinceFromDate
It Returns the number of days from source date to the given date
source_date given_date
Let us know if u face any issue ?
DaysSinceFromDate
It Returns the number of days from source date to the given date
source_date given_date
Let us know if u face any issue ?
Thanks
Swapnil
"Whenever you find whole world against you just turn around and Lead the world"
Swapnil
"Whenever you find whole world against you just turn around and Lead the world"
Re: Need Days from two Dates
hi
I tried, I did not get expected result
here is what I tried
DaysSinceFromDate(Date1) - DaysSinceFromDate(Date2)
I tried, I did not get expected result
here is what I tried
DaysSinceFromDate(Date1) - DaysSinceFromDate(Date2)
Code: Select all
DaysSinceFromDate(Date1,Date2)
You are the creator of your destiny - Swami Vivekananda
Hi,
anbu Wrote
--------------------------------------------------------------------------------
Code:
DaysSinceFromDate(Date1,Date2)
---------------------------------------------------------------------
DaysSinceFromDate(Date Column, Format Specifier).
Can we mention a second date to find the difference?
Thanks
Naveen
anbu Wrote
--------------------------------------------------------------------------------
Code:
DaysSinceFromDate(Date1,Date2)
---------------------------------------------------------------------
DaysSinceFromDate(Date Column, Format Specifier).
Can we mention a second date to find the difference?
Thanks
Naveen
I tried but this is not working. I am just getting 0 days. I am not getting exact days. I am trying to load the difference into integer datatype. Does this makes any diff.?anbu wrote:Code: Select all
DaysSinceFromDate(Date1,Date2)
-
- Participant
- Posts: 19
- Joined: Sat Dec 19, 2009 8:50 am
- Location: Chennai
-
- Participant
- Posts: 2
- Joined: Thu Nov 18, 2010 6:17 am
- Location: hyderabad