473,387 Members | 1,379 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,387 software developers and data experts.

Calendar Table

Hello, I have a query for suspending students. I want to take the suspension day, add the days suspended (-1 to include the first day of suspension)then exclude weekends and holidays. I already have a calendar table in my database. I am currently using the following function
Expr1: DateAdd("d",Suspension_Tracker_1A!Behavior_Num_Of_ Days-1,Suspension_Tracker_1A!Behavior_Date_Report)to count the first day of suspension and end up with the last day of suspension, however I now need to add the omission of holidays and weekends. I am looking at this function as part of the solution
DCount(“*”,”Table_Calendar”,”(Date BETWEEN #” &[Open Date] & “# AND #” &NZ ([Closed Date], Now()) & “#) AND Is_Weekend=False AND Is_Holiday=False”) I pulled this off of the net so the fields are obvioulsy incorrect and I am thinking I need to morph these two together to get what I need. Can anyone help? Thank You
Feb 25 '12 #1
2 2866
Mihail
759 512MB
An idea:
Assuming that your calendar table contain a field Day_Date (this field must exist because the table is a calendar) and a field named IsHolyday (Yes/No type of data) design a query based on this table using this conditions:

Under the field Day_Date:
- first row in Criteria: >= FirstDayOfSuspension
- second row in Criteria: <= LastDayOfSuspension (calculate with DateAdd() function)
Under field IsHolyday:
- Yes

Count the records for this query and subtract the result from total days of suspension.

Maybe other one can sketch the SQL for that.
Sorry, but based on my skills, I can't.

Good luck !
Feb 25 '12 #2
Mihail
759 512MB
I think that is a little mistake in my first post:
You must ADD, not subtract, this days.
But, by adding this days, new holidays can occur.
So you must iterate the calculation for number of days until no more holidays occur.
Feb 25 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sugapablo | last post by:
Can someone recommend a very simple script to produce a web calendar? I just want something where I can select a month and year and it produces a very basic HTML table, 7 columns across, one...
2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
3
by: rcamarda | last post by:
Hi, I wish to create new rows of data based on a source table. Example: I have a file that contains a SESSION (time roughly a calendar quarter for a University), START_DT, END_DT. I want to...
4
by: Sue | last post by:
document.GetElementByID(thiscalendarcontrol_ID).selecteddate doesn't grab the selected date from the given calendar (client-side), nor does .value or ..test. What's the magic syntax? I'm seeing...
2
by: todd.freed | last post by:
Hi All, I am using the <asp: Calendar> object. In the OnDayRender event handler I am putting text into certain day boxes, and leaving others blank. The effect is that some months have no...
0
by: Jessica Weiner | last post by:
I have a web calendar application which retrieves events from a SQL database. These events are real-life events (group meetings and workshops etc). I want the ability to create an automatic 5x7...
0
by: keri | last post by:
Hi everyone, I have read through all posts on this subject & articles on Microsoft, etc etc but I am not much clearer and really need pointing to the right starting point. I am wanting to my...
1
by: abhishekbrave | last post by:
The code below is opening a calendar on mouse over in the same window. I need the calendar to be opened in new window. Have to fulfill this requirement urgentely so posting the whole code here. I...
1
by: vp.softverm | last post by:
hi all . Am facing problem with the date picker. when i click on date picker in a popup window. the date table is opened in the middle of the pop up window. and it is unable to scroll with...
8
by: Arhaus | last post by:
I was wondering if someone could help me out. I am new to jscript and I need to modify a calendar onclick event. We have a calendar which displays the dates either in green or red based upon data...
0
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
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 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.