473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Fiscal Calendar?

If I have Calendar Control on Asp.net page and I have a table for
Fiscal years on sql server
then, How can I check the dates from table to Calendar Control,so that
I can format the Calendar control cells according to my need.
I want to change the color of Dates according to fiscal month. i.e. As
Calendar control has dates for Current + next + Previous months, I need

to change the color of dates of month which is comes under Fiscal
month.
I have table for fiscal years, which has following :

CREATE TABLE [AccountingCalendar] (
[AccountingCalendarID] [int] IDENTITY (1, 1) NOT NULL ,
[FiscalYear] [smallint] NOT NULL ,
[FiscalQuarter] [tinyint] NOT NULL ,
[FiscalMonth] [tinyint] NOT NULL ,
[MonthName] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT
NULL ,
[MonthStart] [smalldatetime] NOT NULL ,
[MonthEnd] [smalldatetime] NOT NULL ,
[CalendarYear] [smallint] NOT NULL ,
[CalendarQuarter] [tinyint] NOT NULL ,
[CalendarMonth] [tinyint] NOT NULL ,
[NoOfWeeks] [tinyint] NOT NULL ,
CONSTRAINT [pkAccountingCalendar] PRIMARY KEY CLUSTERED
(
[AccountingCalendarID]
) WITH FILLFACTOR = 90 ON [PRIMARY]
) ON [PRIMARY]
GO
And data according to it.
Now How can I check the dates from these table with Calendar Date and
change the backgrond color for the month Started from MonthStart to
MonthEnd field of table.
Any suggestion or help will be appriciated.
TIA

Jul 31 '06 #1
1 2205
Hello TIA,

From your question I am assuming you want to color the background of each
day depending upon some criteria. In order to do that you will want to create
an event handler for the Calendar control's DayRender event. In your code,
get the data from SQL into some in-memory datastore (DataTable probably in
the PageLoad event). Then, in the DayRender event handler query the in-memory
datastore against the DayRenderEventArg e.Day and set the e.Cell.BackColor
appropriately. Something like this pseudocode:

private void calBigMarathon_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
if (e.Day.Date.DayOfYear == dtFiscal.Solvent)
{
set e.Cell.BackColor = black;
}
else
{
set e.Cell.BackColor = red;
}
}

--
enjoy - brians
http://www.limbertech.com
"aj***********@gmail.com" wrote:
If I have Calendar Control on Asp.net page and I have a table for
Fiscal years on sql server
then, How can I check the dates from table to Calendar Control,so that
I can format the Calendar control cells according to my need.
I want to change the color of Dates according to fiscal month. i.e. As
Calendar control has dates for Current + next + Previous months, I need

to change the color of dates of month which is comes under Fiscal
month.
I have table for fiscal years, which has following :

CREATE TABLE [AccountingCalendar] (
[AccountingCalendarID] [int] IDENTITY (1, 1) NOT NULL ,
[FiscalYear] [smallint] NOT NULL ,
[FiscalQuarter] [tinyint] NOT NULL ,
[FiscalMonth] [tinyint] NOT NULL ,
[MonthName] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT
NULL ,
[MonthStart] [smalldatetime] NOT NULL ,
[MonthEnd] [smalldatetime] NOT NULL ,
[CalendarYear] [smallint] NOT NULL ,
[CalendarQuarter] [tinyint] NOT NULL ,
[CalendarMonth] [tinyint] NOT NULL ,
[NoOfWeeks] [tinyint] NOT NULL ,
CONSTRAINT [pkAccountingCalendar] PRIMARY KEY CLUSTERED
(
[AccountingCalendarID]
) WITH FILLFACTOR = 90 ON [PRIMARY]
) ON [PRIMARY]
GO
And data according to it.
Now How can I check the dates from these table with Calendar Date and
change the backgrond color for the month Started from MonthStart to
MonthEnd field of table.
Any suggestion or help will be appriciated.
TIA

Aug 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MissiMaths | last post by:
This isn't really an access question as I can write the code myself(I hope) but need to know how the start of the financial year is worked out. If someone knows the rules or an algorithm, I would...
3
by: haydn_llewellyn | last post by:
Hi, My company runs on a fiscal calendar that starts on the first monday in July, and is based on a 13 week quarter (4 weeks, 4 weeks, 5 weeks). What I need, is a way of relating Date() to the...
2
by: JohnC | last post by:
This fantastic expression was posted by Duane Hookom. I have no idea how it works but it displays the fiscal year and quarter for FY starting on October 1. =Format$(DateAdd("q",1,),"\Qq...
1
by: rkohon | last post by:
Hello all, I am new to JavaScript and need some ideas, suggestions, or code snippets. I have a form which requires the end user to put in a date for required items. I need javascript function to...
4
by: Twobridge | last post by:
Hi I am trying to perform a search that will return records based on a fiscal year search of the bill_Date. The user gives the year then I want to search based on the fiscal year (July 1 - June...
2
by: Sund via AccessMonster.com | last post by:
I do fair amount of data analysis using access pivot tables and charts. Can any body suggest a method to run the queries based on accounting month and Accounting year.As an example: I want to...
4
by: ltazz | last post by:
How can i make it so that Access will Recognize the fiscal year 07 start at 1 oct 2006, and end 30 Sep 2007? i know its possible, however cant figure it out. Thanks for the help in advance you...
3
by: shiznaw | last post by:
I got another problem while working on this database for the Univ. The Form.viewreports has several radial button options so that the user can view a Report for several periods--like a day, a...
2
by: RZ15 | last post by:
Hi guys, I'm really drawing a blank here for how to deal with fiscal months in my monthly sales/receipts reports. My issue is that calculating the months is not as simple as saying 'if the invoice...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.