display all dates between two dates [message #348718] |
Wed, 17 September 2008 15:19 |
justbegginer
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
Hi all, i am new to this forum. Hope everyone doing great!
I am trying to write a query that display all the months available between two dates.
Lets say i have service table. That has fields like Service_start_date and service_end_date.
When i do service_start_date - service_end_date, i want to get all the dates between two dates.
Can anyone help me on this?
THanks in advance
|
|
|
|
Re: display all dates between two dates [message #348730 is a reply to message #348719] |
Wed, 17 September 2008 16:12 |
justbegginer
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
Hi all, i treid to get the months with montly sal
This query gave me all month numbers
select distinct t.f_month_number
from time_dim t
where
f_date between (select start_date from employee where emp_id = 111 ) and
(select add_months(start_Date,12) from employee where emp_id = 111)[b]
but when i add the sal value...
select distinct t.f_month_number,p.start_date,round(replace(p.total_sal,',','')/12,2) as Monthly_sal
from time_dim t, employee p
where
t.f_date = p.start_date and
f_date between (select start_date from employee where emp_id = 111 ) and
(select add_months(start_Date,12) from employee where emp_id = 111)
i got only one month value. How do i resolve this issue.
|
|
|
|
|