How to find out the number of days in a financial year.
suppose from date is sep1st,2006.and to date is aug24th,2009.
the entire range involves financial years.i.e.,
april1st,2006-march31st,2007
april1st,2007-march31st,2008
april1st,2008-march31st,2009
april1st,2009-march31st,2010.
we have to calculate the no.of days of last financial year..
waiting for reply..
2 6103
How to find out the number of days in a financial year.
suppose from date is sep1st,2006.and to date is aug24th,2009.
the entire range involves financial years.i.e.,
april1st,2006-march31st,2007
april1st,2007-march31st,2008
april1st,2008-march31st,2009
april1st,2009-march31st,2010.
we have to calculate the no.of days of last financial year..
waiting for reply..
hi,
you need to use a function as
CREATE FUNCTION calcdays
(
@startyear int,
@endyear int
)
RETURNS int
AS
BEGIN
declare @count int
set @count = 0
while @startyear <= @endyear
begin
if @startyear % 4 = 0 set @count = @count + 1
set @startyear = @startyear + 1
end
RETURN @count
END
GO
and call the function as
select datediff(dd, '2006-09-01','2009-08-24' ) + dbo.calcdays(year('2006-09-01'),year('2009-08-24'))
If you want number of days for each interval write a stored procedure or function to get the values
thanks
How to find out the number of days in a financial year.
suppose from date is sep1st,2006.and to date is aug24th,2009.
the entire range involves financial years.i.e.,
april1st,2006-march31st,2007
april1st,2007-march31st,2008
april1st,2008-march31st,2009
april1st,2009-march31st,2010.
we have to calculate the no.of days of last financial year..
waiting for reply..
Are you looking at finding the number of days between sep1st,2006.and to date is aug24th,2009 or something else?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: chennakeshava_ramesh |
last post by:
hi,
I have a problem, I am not able to find out which day of the week it
is using the calendar class.
I am using set() function to set the date
and want to find out which day i.e mon,tue etc of...
|
by: Shuffs |
last post by:
Could someone, anyone please tell me what I need to amend, to get this
function to take Sunday as the first day of the week?
I amended the Weekday parts to vbSunday (in my code, not the code...
|
by: Ali Baba |
last post by:
Hi,
Is there is equivalent of VB's DateDiff() method in C#. I need to find
difference in months between two dates that are years apart. Docs says
that I can use TimeSpan like:
TimeSpam ts =...
|
by: RD |
last post by:
Say Company's financial year starts October First and say we are now March
17th. How do you determine which quarter of the Financial year - not the
actual year - March 17th is in.
Thanks for any...
|
by: james |
last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old
database file that has the date(s) stored in it as number of days.
An...
|
by: thebjorn |
last post by:
For the purpose of finding someone's age I was looking for a way to
find how the difference in years between two dates, so I could do
something like:
age = (date.today() - born).year
but that...
|
by: Beemer Biker |
last post by:
I cant seem to get that date into any DateTime to make my calculation
directly by subtracting "01-01-0000" from "now".
After reading this:...
|
by: crabb |
last post by:
I would like to know if anyone knows how to set up an app that would
count the number of specific days in a user defined year. example,
how many Sundays, Mondays, Tuesdays, etc. in 2007 or a user...
|
by: Tommy Jakobsen |
last post by:
Hi.
Is there a method in .NET that takes "year" as an argument and returns the total
number of weeks in that year? For culture da-DK (Danish).
Thanks in advance.
Tommy.
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |