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

Insert all sundays and second saturdays in a holiday table.

Dear All,
I have a holiday table and i need to insert all sundays and second saturdays into the table using a stored procedure.There are 4 columns in the table such as holiday_id,holiday_date,updated_on and updated_by.Please guide me.I am a fresher in this field..
Nov 27 '12 #1
2 3106
zmbd
5,501 Expert Mod 4TB
Bytes is not a code writing nor homework service. However, if you will provide the work you've already attempted someone here might be able to point you in the correct direction.
Nov 27 '12 #2
This is my code.It displays all sundays but it shows second saturdays only for the first 3 months.From April it is irregular and showing 1st 3rd saturdays.

Expand|Select|Wrap|Line Numbers
  1. select to_date(to_char(d, 'YYYY-MM-DD'),'YYYY-MM-DD') from generate_series('2012-01-01'::date, '2012-12-31','1day') g(d) where extract(dow from d) = 0 or (extract(dow from d) = 6 and extract(week from d)::int % 2 = 0 and extract(week from d)::int % 4 <> 0);
Please anyone guide me..
Dec 4 '12 #3

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

Similar topics

11
by: grumfish | last post by:
I'm trying to add a row to a MySQL table using insert. Here is the code: connection = MySQLdb.connect(host="localhost", user="root", passwd="pw", db="japanese") cursor = connection.cursor()...
3
by: king | last post by:
Anyone know if there is method that can insert all record from a table in an MS Access 2000 database to a table in MS SQL Server 2000 database by a SQL statement? (Therefore, I can execute the...
1
by: Alain Filiatrault | last post by:
HI, I have an SQL Server table with only 1 column. That column is an identity column. How can I insert a row in this table using SQL syntax? I tried insert into T_tableName () values ()...
0
by: Ian Macey | last post by:
I am wanting to Insert multiple records into a table, and although I have some working code I feel that there must be a better way. The purpose of the code is to do a directory listing of a...
2
by: VM | last post by:
What's the fastest way to insert data into an Access table? I'm currently using ExecuteNonQuery but it seems to take too long (should filling an mdb table be slower than filling a datatable?). So...
0
by: swatijogdand | last post by:
how to insert data in a linked table through a pass through query? pass through query and linked table are attached to the access database at runtime.Also ,pass through query contains stored...
3
by: Dave | last post by:
I'm writing a c# Windows program that needs to be able to insert records into a dbase table. I can read it using a dataset but can't insert records. I receive the following error, ERROR ...
0
by: KA NMC | last post by:
I have a table and a view. My view pulls all new items which needs to be updated and my table has all the new items that already has been updated. What I'm trying to do in a windows application...
3
by: deneushasler | last post by:
Hello my name is Juan Jose. My problem is as follows. When I try to insert a record into a table (access) to control DetailsView Visual Web Developer 2005, when I run the page and insert a record...
3
by: Kunal Desale | last post by:
Hi, How to insert/update data in foxpro table field having datatype MEMO using Linked Server? I have written sql insert queries in which i have used linked server to insert data into foxpro...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.