Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Date Function

6 posts in General Discussion Last posting was on 2004-02-24 22:13:37.0Z
Chandresh Patel Posted on 2004-02-23 14:10:20.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
Subject: Date Function
Lines: 16
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: ac9b18bd.ipt.aol.com
X-Original-NNTP-Posting-Host: ac9b18bd.ipt.aol.com
Message-ID: <403a09cc@forums-1-dub>
Date: 23 Feb 2004 06:10:20 -0800
X-Trace: forums-1-dub 1077545420 172.155.24.189 (23 Feb 2004 06:10:20 -0800)
X-Original-Trace: 23 Feb 2004 06:10:20 -0800, ac9b18bd.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2587
Article PK: 5725

Hi,

Is there any function available in Sybase Anywhere 9.0.0(1108) that return
specific value like :

1. Current Week dates >> Week start date and Week end date
2. Quarter dates >> Quarter start date and quarter
end date.
3. Month dates >> Month start date and Month end
date

Thanks in Advance.


David Fishburn Posted on 2004-02-23 15:05:21.0Z
Newsgroups: ianywhere.public.general
Subject: Re: Date Function
From: David Fishburn <fishburn_spam_off@ianywhere.com>
References: <403a09cc@forums-1-dub>
Organization: iAnywhere Solutions
Message-ID: <Xns949866924D766fishburnsybasecom@10.22.241.106>
User-Agent: Xnews/06.08.25
NNTP-Posting-Host: 172.31.143.254
X-Original-NNTP-Posting-Host: 172.31.143.254
Date: 23 Feb 2004 07:05:21 -0800
X-Trace: forums-1-dub 1077548721 172.31.143.254 (23 Feb 2004 07:05:21 -0800)
X-Original-Trace: 23 Feb 2004 07:05:21 -0800, 172.31.143.254
Lines: 33
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2590
Article PK: 5728

"Chandresh Patel" <bapashree@yahoo.com> wrote in
news:403a09cc@forums-1-dub:

Have you read through the Help file on functions?

From the 9.0.1 Help file:

ASA SQL Reference
SQL Functions
Function types
Date and time functions

--
David Fishburn
NEW - Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
http://ianywhere.codexchange.sybase.com/servlets/ProjectDocumentList


Chris Keating (iAnywhere Solutions) Posted on 2004-02-23 15:05:41.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <403a09cc@forums-1-dub>
Subject: Re: Date Function
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: keating-xp.sybase.com
Message-ID: <403a16ce$1@forums-2-dub>
X-Original-Trace: 23 Feb 2004 07:05:50 -0800, keating-xp.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Feb 2004 07:05:16 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Feb 2004 07:05:41 -0800
X-Trace: forums-1-dub 1077548741 10.22.108.75 (23 Feb 2004 07:05:41 -0800)
X-Original-Trace: 23 Feb 2004 07:05:41 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2591
Article PK: 5734

See DATEPART function [Date and time]

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

****************************************************************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

"Chandresh Patel" <bapashree@yahoo.com> wrote in message
news:403a09cc@forums-1-dub...
> Hi,
>
> Is there any function available in Sybase Anywhere 9.0.0(1108) that return
> specific value like :
>
> 1. Current Week dates >> Week start date and Week end date
> 2. Quarter dates >> Quarter start date and
quarter
> end date.
> 3. Month dates >> Month start date and Month
end
> date
>
> Thanks in Advance.
>
>
>
>


Chandresh Patel Posted on 2004-02-23 15:47:05.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <403a09cc@forums-1-dub> <403a16ce$1@forums-2-dub>
Subject: Re: Date Function
Lines: 69
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: ac9b18bd.ipt.aol.com
Message-ID: <403a2084$1@forums-2-dub>
X-Original-Trace: 23 Feb 2004 07:47:16 -0800, ac9b18bd.ipt.aol.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Feb 2004 07:46:41 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Feb 2004 07:47:05 -0800
X-Trace: forums-1-dub 1077551225 10.22.108.75 (23 Feb 2004 07:47:05 -0800)
X-Original-Trace: 23 Feb 2004 07:47:05 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2596
Article PK: 5733

David and Chris,

I want fully start date and end date not part of date. I read whole help
file for this but my requirment is different.


Thanks


"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:403a16ce$1@forums-2-dub...
> See DATEPART function [Date and time]
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>
****************************************************************************
> *
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
> and try out the market-leading database for mobile, embedded and small to
> medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>
****************************************************************************
> *
>
> iAnywhere Solutions http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use CaseXpress to report bugs http://casexpress.sybase.com
>
>
****************************************************************************
> *
>
> "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> news:403a09cc@forums-1-dub...
> > Hi,
> >
> > Is there any function available in Sybase Anywhere 9.0.0(1108) that
return
> > specific value like :
> >
> > 1. Current Week dates >> Week start date and Week end
date
> > 2. Quarter dates >> Quarter start date and
> quarter
> > end date.
> > 3. Month dates >> Month start date and Month
> end
> > date
> >
> > Thanks in Advance.
> >
> >
> >
> >
>
>


David Fishburn Posted on 2004-02-24 13:57:00.0Z
Newsgroups: ianywhere.public.general
Subject: Re: Date Function
From: David Fishburn <fishburn_spam_off@ianywhere.com>
References: <403a09cc@forums-1-dub> <403a16ce$1@forums-2-dub> <403a2084$1@forums-2-dub>
Organization: iAnywhere Solutions
Message-ID: <Xns94995AF72CA38fishburnsybasecom@10.22.241.106>
User-Agent: Xnews/06.08.25
NNTP-Posting-Host: 172.31.140.214
X-Original-NNTP-Posting-Host: 172.31.140.214
Date: 24 Feb 2004 05:57:00 -0800
X-Trace: forums-1-dub 1077631020 172.31.140.214 (24 Feb 2004 05:57:00 -0800)
X-Original-Trace: 24 Feb 2004 05:57:00 -0800, 172.31.140.214
Lines: 36
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2609
Article PK: 5746

"Chandresh Patel" <bapashree@yahoo.com> wrote in
news:403a2084$1@forums-2-dub:

CP> I want fully start date and end date not part of date. I read whole
CP> help file for this but my requirment is different.

It is a matter of using the functions provided.
There is no one function to do everything you want, but you can combine
functions to give you what you want.

Run this query in DBISQL.
select current timestamp as today
, datepart( weekday, current timestamp)
, datepart( calweekofyear, current timestamp) WeekOfYear
, datepart( caldayofweek, current timestamp) as DayOfWeek
, dateadd(day, 0, current timestamp)
, dateadd(day, (0-datepart( caldayofweek, current timestamp)), current
timestamp) as SundaysDate

The last column should be the DATE of the FIRST Sunday of the week.
Given you have the default FIRST_DAY_OF_WEEK option.

The above was done using 9.0.1 (if that matters).

, dateadd(day, (0-datepart( caldayofweek, current timestamp)), current
timestamp) as SundaysDate

This takes today, and adds (or really substracts)
0 - day of the week.
0 - datepart( caldayofweek, current timestamp)
0 - 2 (Tues)

So take today - substract 2 days = Date of Sunday of each week.

--
David Fishburn


Chandresh Patel Posted on 2004-02-24 22:13:37.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <403a09cc@forums-1-dub> <403a16ce$1@forums-2-dub> <403a2084$1@forums-2-dub> <Xns94995AF72CA38fishburnsybasecom@10.22.241.106>
Subject: Re: Date Function
Lines: 43
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: aca8b22b.ipt.aol.com
Message-ID: <403bcca0@forums-2-dub>
X-Original-Trace: 24 Feb 2004 14:13:52 -0800, aca8b22b.ipt.aol.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 Feb 2004 14:13:06 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 Feb 2004 14:13:37 -0800
X-Trace: forums-1-dub 1077660817 10.22.108.75 (24 Feb 2004 14:13:37 -0800)
X-Original-Trace: 24 Feb 2004 14:13:37 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2624
Article PK: 6098

Thank you very very much

"David Fishburn" <fishburn_spam_off@ianywhere.com> wrote in message
news:Xns94995AF72CA38fishburnsybasecom@10.22.241.106...
> "Chandresh Patel" <bapashree@yahoo.com> wrote in
> news:403a2084$1@forums-2-dub:
>
> CP> I want fully start date and end date not part of date. I read whole
> CP> help file for this but my requirment is different.
>
> It is a matter of using the functions provided.
> There is no one function to do everything you want, but you can combine
> functions to give you what you want.
>
> Run this query in DBISQL.
> select current timestamp as today
> , datepart( weekday, current timestamp)
> , datepart( calweekofyear, current timestamp) WeekOfYear
> , datepart( caldayofweek, current timestamp) as DayOfWeek
> , dateadd(day, 0, current timestamp)
> , dateadd(day, (0-datepart( caldayofweek, current timestamp)), current
> timestamp) as SundaysDate
>
> The last column should be the DATE of the FIRST Sunday of the week.
> Given you have the default FIRST_DAY_OF_WEEK option.
>
> The above was done using 9.0.1 (if that matters).
>
> , dateadd(day, (0-datepart( caldayofweek, current timestamp)), current
> timestamp) as SundaysDate
>
> This takes today, and adds (or really substracts)
> 0 - day of the week.
> 0 - datepart( caldayofweek, current timestamp)
> 0 - 2 (Tues)
>
> So take today - substract 2 days = Date of Sunday of each week.
>
> --
> David Fishburn