Code to find weekends in Sybase.


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Code to find weekends in Sybase.
# 1  
Old 11-26-2008
Code to find weekends in Sybase.

Hi All,

I need a help here, actually i want SQl code which will determine all Saturdays and Sunday in given year (say 2009) and display it's dates.

E.g :-
3 ---> Saturday
4 --> Sunday (for 2009) and so on.

Thanks in Advance for help.

Regards,
Arvind.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

2. Shell Programming and Scripting

Script to find n.of weekdays and n.of weekends in a given date

Hi All, Could you please provide the shell script to find number of weekdays and number of weekends for a given date for that month. Monday to friday should be considered as weekdays and Saturday and Sunday should be considered as weekends. Date should be passed as parameter. For... (13 Replies)
Discussion started by: ROCK_PLSQL
13 Replies

3. Emergency UNIX and Linux Support

Help with Sybase DB

Hi, I'm facing an emergency situation, wherein I have to provide limited support to a Sybase DB temporarily as the DBA was fired. There is an urgent need of adding to users to the database. After some time on google, I was able to gather the below information on the database setup ... (1 Reply)
Discussion started by: maverick_here
1 Replies

4. Shell Programming and Scripting

Sybase server

I have requirement to connect to different sybase server's and store the data into flat file and load into oracle using sqlloader for each day drop the table and re create it and load the data based on business date as parameter which was taking from parameter file.Any help on this should be... (0 Replies)
Discussion started by: mohan705
0 Replies

5. Shell Programming and Scripting

Sybase 12/15 compatability

This is more a database problem than a shell one, but we have a problem affecting our scripts, so I'm stretching the limits a bit! ;) We're in the process of migrating our application and a large number of associated scripts from Sybase 12.5.4 to Sybase 15. Scripts using 'isql' and 'bcp' include... (1 Reply)
Discussion started by: JerryHone
1 Replies

6. Shell Programming and Scripting

sybase::bcp

I am trying to bcp in using sybase::bcp perl module. I can find we can give user, pwd and server name in the parameters. How can I give database and table name? (1 Reply)
Discussion started by: Deei
1 Replies

7. What is on Your Mind?

What do you do during weekends ? :)

Its been a while since we had any fun polls or interesting topics in this forum. So, here I start a thread rather calling it as a question - " What do you do during weekends ? :) " For many, on hearing the term - weekends should excite them :b: for ( few ) some - uhhh .. its just another day... (11 Replies)
Discussion started by: matrixmadhan
11 Replies

8. Shell Programming and Scripting

sybase and shell

I am writing a shell script that verifies if a device is created on wrong mounts 1> sp_helpdevice 2> go | awk '{print $2}' | grep database | grep -v `df -k | grep /dev/dsk | awk '{print $6}'` So if things are ok, the output should return nothing If the result gives 1 or more entry, then... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

9. Solaris

Connect From VB to Sybase 11

Dear All I have a problem that I can't connect from VB to Sybase 11. Could you help me? (2 Replies)
Discussion started by: Than Chanroeun
2 Replies
Login or Register to Ask a Question
CAL(1)							    BSD General Commands Manual 						    CAL(1)

NAME
cal, ncal -- displays a calendar and the date of Easter SYNOPSIS
cal [-3hjy] [-A number] [-B number] [[month] year] cal [-3hj] [-A number] [-B number] -m month [year] ncal [-3bhjJpwySM] [-A number] [-B number] [-s country_code] [[month] year] ncal [-3bhJeoSM] [-A number] [-B number] [year] ncal [-CN] [-H yyyy-mm-dd] [-d yyyy-mm] DESCRIPTION
The cal utility displays a simple calendar in traditional format and ncal offers an alternative layout, more options and the date of Easter. The new format is a little cramped but it makes a year fit on a 25x80 terminal. If arguments are not specified, the current month is dis- played. The options are as follows: -h Turns off highlighting of today. -J Display Julian Calendar, if combined with the -e option, display date of Easter according to the Julian Calendar. -e Display date of Easter (for western churches). -j Display Julian days (days one-based, numbered from January 1). -m month Display the specified month. If month is specified as a decimal number, it may be followed by the letter 'f' or 'p' to indicate the following or preceding month of that number, respectively. -o Display date of Orthodox Easter (Greek and Russian Orthodox Churches). -p Print the country codes and switching days from Julian to Gregorian Calendar as they are assumed by ncal. The country code as deter- mined from the local environment is marked with an asterisk. -s country_code Assume the switch from Julian to Gregorian Calendar at the date associated with the country_code. If not specified, ncal tries to guess the switch date from the local environment or falls back to September 2, 1752. This was when Great Britain and her colonies switched to the Gregorian Calendar. -w Print the number of the week below each week column. -y Display a calendar for the specified year. This option is implied when a year but no month are specified on the command line. -3 Display the previous, current and next month surrounding today. -1 Display only the current month. This is the default. -A number Months to add after. The specified number of months is added to the end of the display. This is in addition to any date range selected by the -y, -3, or -1 options. For example, ``cal -y -B2 -A2'' shows everything from November of the previous year to Febru- ary of the following year. Negative numbers are allowed, in which case the specified number of months is subtracted. For example, ``cal -y -B-6'' shows July to December. And ``cal -A11'' simply shows the next 12 months. -B number Months to add before. The specified number of months is added to the beginning of the display. See -A for examples. -C Switch to cal mode. -N Switch to ncal mode. -d yyyy-mm Use yyyy-mm as the current date (for debugging of date selection). -H yyyy-mm-dd Use yyyy-mm-dd as the current date (for debugging of highlighting). -M Weeks start on Monday. -S Weeks start on Sunday. -b Use oldstyle format for ncal output. A single parameter specifies the year (1-9999) to be displayed; note the year must be fully specified: ``cal 89'' will not display a calendar for 1989. Two parameters denote the month and year; the month is either a number between 1 and 12, or a full or abbreviated name as speci- fied by the current locale. Month and year default to those of the current system clock and time zone (so ``cal -m 8'' will display a calen- dar for the month of August in the current year). Not all options can be used together. For example, the options -y, -3, and -1 are mutually exclusive. If inconsistent options are given, the later ones take precedence over the earlier ones. A year starts on January 1. SEE ALSO
calendar(3), strftime(3) HISTORY
A cal command appeared in Version 5 AT&T UNIX. The ncal command appeared in FreeBSD 2.2.6. The output of the cal command is supposed to be bit for bit compatible to the original Unix cal command, because its output is processed by other programs like CGI scripts, that should not be broken. Therefore it will always output 8 lines, even if only 7 contain data. This extra blank line also appears with the original cal command, at least on solaris 8 AUTHORS
The ncal command and manual were written by Wolfgang Helbig <helbig@FreeBSD.org>. BUGS
The assignment of Julian-Gregorian switching dates to country codes is historically naive for many countries. Not all options are compatible and using them in different orders will give varying results. BSD
March 14, 2009 BSD