.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Get Years

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :Sql Server
Hi all, I need to get the financial year and financial year plus one. My financial year is April. So for this year it would be 2011 2012 please tell me how to do this  

View Complete Post

More Related Resource Links


How to calculate childs age,but when i enter childs age as '03/27/2007' it returns 3 years where as actual age is 2 yr 11 months

Tab container rendered with visibility:hidden - This was reported over three years ago.



Here is (more) code that demonstrates the issue.  If the control in the host page is removed the tab control renders correctly.  Otherwise it is rendered with the visibility attrubute set to hidden as reported in the above link.  Is this broken or am I doing something wrong?



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="S2.aspx.cs" Inherits="S2" %>
<%@ Register Src="~/SelectorPatternControl.ascx" TagName="TestControl" TagPrefix="sam" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <cc1:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></cc1:ToolkitScriptManager>

Trustworthy Computing: Lessons Learned from Five Years of Building More Secure Software


Five years ago, Bill Gates issued a directive to enhance security across the board. Since then, many valuable lessons have been learned about building more secure software.

Michael Howard

MSDN Magazine November 2007

Editor's Note: 20 Years and Still Going Strong!


Microsoft Systems Journal (MSJ) was founded in 1986. At the time, no other publication focused specifically on the needs of programmers who were using Microsoft tools and technologies. Two issues were produced in the first year, each with five articles.

Joshua Trupin

MSDN Magazine April 2005

Algorithm for Computing Age in Years, Months and Days?

I am generating a crystal report.net that compute age of a person through formula. of course, there is the birthdate and current date. I am familiar with the datediff function but I want to compute is like: "18 Years, 2 Months and fifteen days old." it should include the leap year. Any Algorithm that I can apply to crystal report formula? Your help is very appreciated.

Needing two different years pulled from same select statment

Making a sales,cost table equal for one year select all sales from dbo where year = 2008 select all costs from dbo where year = 2008 but now i want to put beside this table select all sales from dbo where year = 2009 select all costs from dbo where year = 2009    How can i achieve this in one table?   Thanks for all the help

Had working Stored Procedure for years and broke all of sudden

I had a stored procedure that used a simple cursor to do a query against a linked SQL 2005 database.  It worked for years and failed out of the blue a month ago and the only way to fix it was to modify the cursor declaration to make it INSENSITIVE.  Any ideas why this would be?  No data is modified on the linked DB, just the local DB.  Seems weird this worked for years up until mid-august.  All SPs with cursors that were not local had to be modified to be INSENSITIVE.   Thanks Henry    MVP WanneBe

function or query to return continuous span of months $ years as rows in query



I am using SS2008.

There are many situations in which I need to return a table where the rows are EVERY calendar month between two dates, not just the months where there is data present.

Is there a function that would take a beginning and end date mmddyyyy which would do this?

For example if I wanted 1/2004 through 8/2010?




and so on to





Thanks in advance,




How to calculate difference between two dates in years


hi all, 

i need to know if, given a birth date, a person has more than x years. Thats mean, the client must entry a date in a textbox and i need to know if the persona has more than 18 years. 

Thx in advance

Displaying data from two years on same chart


I want to display sales data by month from the current year and the previous year on the same chart.  I've created two data sets, each of which has [month] as one of it's members.  I set up the chart with two different Values members: Current & Previous and one Category group: Month.  The current year data displays as expected but the previous year just shows as a straight line across the chart.

Can I get both sets of data to display on the same chart?

I tried building a single query that would return a single dataset with two values, one for current year/month sales and another for previous year/month sales but my MDX isn't that good so I ended up with different queries.

MDX Custom Calculations for current quarter and last years



I have a measure [Measures].[Estimated Value] and i have hierarchy [EstimatedCloseDate].[Calendar Time] with normal attributes like Year<-Quarter<-Month-<Date.

I am trying to figure out two name sets. One requirement is I want:

sum of previous estimated value,Current Quarter (Q4 2010), Q1 2011, Q2 2011, Q3 20100, sum of future estimated value

Second requirement is:

Last year estimated value, Q1 2010, Q2 2010, Q3 2010, Q4 2010 --I mean all quarters of current year.

I would really appreciate the help guys.



Correct Time Dimension Settings to Hide Extra Years in Drop List


This is going to be easy for the experts to answer (I hope). Here is my problem:

1) I have a Fact table that is linked via a TimeKey (Not date, it is a number) to the Time Dimension table. (I want to build a cube in SSAS)

2) The Fact table contains data from 2008 to 2010 (YTD)

3) The Time Dimension Table includes years  between 2005 to 2015

My problem is:

When I drop years into a column (in the browser) I get the correct year range between 2008 and 2010 (which is correct)


At the same time, when I use the drop down list of the column I can see all the years from 2005 to 2015. (Which is included in the Time Dimension Table)

How can I make those "extra" years disappear from the drop down list? How can those years appear in the browser even though there is no matching "TimeKey" in the fact sheet that would link them.

I know this maybe a simple setting in the Time Dimension but I cannot find it.

Your help is greatly appreciated.


Months and Years between given two dates.


Hello All,

I have one query.

User will input two dates and I want to print months between those two dates.


  1. Suppose user enters From Date : 1-Apr-2010 and To Date : 15-Oct-2010


So my out put should be like









Please reply me sql query for that one as it is needed on urgent bases.

MDX simple query doesnt show the years in the rows but shows (all) with value




this mdx script should return asset value for the individual years but instead it return one line with a value.

When i use the browser in ssas and select the year in rows and measure, it gives the result back as expected ie. years in the rows and values.

Can you help me out please im stuck here:




      [Measures].[Appraisal Forecasted Value] ON COLUMNS,

     [Asset Value Date].[Year] ON ROWS

FROM [CMSX_DWH_OLAP_AssetExposure]

// Result:


// Appraisal Forecasted Value

//All 1,931,290,000  I miss the Years on rows?



// This is from the browser which is correct because the year is added

Year Appraisal Forecasted Value









SSAS Time Dimension (academic years, quarters) change over time


Apologies if I don't state teh question properly or am overlooking obvious answers - just started working with SSAS and barely beginner level.

I'm working on a cube to show student enrollments in different subject areas over time - for this purpose I'm only concerned about academic years and semesters.  In the underlying dimension table I have data like

1 2006          SUMMER  SUMMER 2006
2 2006          FALL  FALL 2006
3 2006          SPRING  SPRING 2007 (note that spring 2007 is part of the 2006 academic year)
4 2007          SUMMER  SUMMER 2007
5 2007          FALL  FALL 2007
6 2007          SPRING  SPRING 2008
and so on

I've set up a simple hierarchy with only two levels - ACAD YEAR->DESCR

For the cube I have one measure: 'Enrollments' which shows the sum of students who have enrolled

What I'd like to be able to do is show the f

Sharepoint under construction page suddenly appears after site has been working for years?

I installed 3 Microsoft updates and then rebooted the web server.  When it came back up, when I browse to the Sharepoint site in either browser or IIS, I get the "Under Construction - The site you are trying to view does not currently have a default page.  It may be in the process of being upgraded and configured."  None of the files have been changed whatsoever.  I tried removing the updates and that made no difference.  Please help!  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend