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.

Getting No of days in a given month

5 posts in Objects Last posting was on 2007-03-08 09:10:11.0Z
John Smith Posted on 2007-03-07 13:57:29.0Z
Sender: 7273.45e56f8e.1804289383@sybase.com
From: John Smith
Newsgroups: sybase.public.powerbuilder.objects
Subject: Getting No of days in a given month
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45eec4c9.6f3f.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 7 Mar 2007 05:57:29 -0800
X-Trace: forums-1-dub 1173275849 10.22.241.41 (7 Mar 2007 05:57:29 -0800)
X-Original-Trace: 7 Mar 2007 05:57:29 -0800, 10.22.241.41
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9262
Article PK: 736421

Hi All,

Do we have any function to get no of days in a given month.
Any builtin function available. if no, can you please tel me
how I can do this.

Thanks in advance for any help,

John


Brad Wery[TeamSybase] Posted on 2007-03-07 14:08:18.0Z
From: "Brad Wery[TeamSybase]" <bradweryatagricoreunited.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Getting No of days in a given month
References: <45eec4c9.6f3f.1681692777@sybase.com>
In-Reply-To: <45eec4c9.6f3f.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: ugg10.unitedgrain.ca
X-Original-NNTP-Posting-Host: ugg10.unitedgrain.ca
Message-ID: <45eec752$1@forums-1-dub>
Date: 7 Mar 2007 06:08:18 -0800
X-Trace: forums-1-dub 1173276498 165.23.247.49 (7 Mar 2007 06:08:18 -0800)
X-Original-Trace: 7 Mar 2007 06:08:18 -0800, ugg10.unitedgrain.ca
Lines: 26
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9263
Article PK: 736422

Take a look at the pfc_n_cst_datetime object in the PFC library
pfcapsrv.pbl. There's a function called of_lastdayofmonth. If you use
this with the PowerScript Day function, you can get the number of days
in a given month.

If your app doesn't use PFC just get your hands on it some other way so
you can see what the function does. It's pretty simple.

Brad

John Smith wrote:
> Hi All,
>
> Do we have any function to get no of days in a given month.
> Any builtin function available. if no, can you please tel me
> how I can do this.
>
> Thanks in advance for any help,
>
> John

--

Join the Advanced GUI Development project on CodeXchange
https://advanced-gui-development.codexchange.sybase.com/


bede Posted on 2007-03-07 14:23:47.0Z
From: bede <bedenosp@msofico.be>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Getting No of days in a given month
Message-ID: <MPG.2058e96494dfb56e98988e@forums.sybase.com>
References: <45eec4c9.6f3f.1681692777@sybase.com> <45eec752$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Date: 7 Mar 2007 06:23:47 -0800
X-Trace: forums-1-dub 1173277427 194.7.38.226 (7 Mar 2007 06:23:47 -0800)
X-Original-Trace: 7 Mar 2007 06:23:47 -0800, uu194-7-38-226.unknown.uunet.be
Lines: 28
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9264
Article PK: 736426

other way: DaysAfter (date1, date2)


In article <45eec752$1@forums-1-dub>, "Brad Wery[TeamSybase]" <bradweryatagricoreunited.com>
says...

> Take a look at the pfc_n_cst_datetime object in the PFC library
> pfcapsrv.pbl. There's a function called of_lastdayofmonth. If you use
> this with the PowerScript Day function, you can get the number of days
> in a given month.
>
> If your app doesn't use PFC just get your hands on it some other way so
> you can see what the function does. It's pretty simple.
>
> Brad
>
> John Smith wrote:
> > Hi All,
> >
> > Do we have any function to get no of days in a given month.
> > Any builtin function available. if no, can you please tel me
> > how I can do this.
> >
> > Thanks in advance for any help,
> >
> > John
>
>
>


Bruce Armstrong [TeamSybase] Posted on 2007-03-07 16:17:52.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <45eec4c9.6f3f.1681692777@sybase.com> <45eec752$1@forums-1-dub> <MPG.2058e96494dfb56e98988e@forums.sybase.com>
Subject: Re: Getting No of days in a given month
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 12.198.167.34
X-Original-NNTP-Posting-Host: 12.198.167.34
Message-ID: <45eee5b0$1@forums-1-dub>
Date: 7 Mar 2007 08:17:52 -0800
X-Trace: forums-1-dub 1173284272 12.198.167.34 (7 Mar 2007 08:17:52 -0800)
X-Original-Trace: 7 Mar 2007 08:17:52 -0800, 12.198.167.34
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9265
Article PK: 736423

How exactly would that help someone determined the number of days in a
particular month?

(There is a way, but you're not providing enough information to point the
person towards it).

"bede" <bedenosp@msofico.be> wrote in message
news:MPG.2058e96494dfb56e98988e@forums.sybase.com...
> other way: DaysAfter (date1, date2)
>
>
> In article <45eec752$1@forums-1-dub>, "Brad Wery[TeamSybase]"
> <bradweryatagricoreunited.com>
> says...
>> Take a look at the pfc_n_cst_datetime object in the PFC library
>> pfcapsrv.pbl. There's a function called of_lastdayofmonth. If you use
>> this with the PowerScript Day function, you can get the number of days
>> in a given month.
>>
>> If your app doesn't use PFC just get your hands on it some other way so
>> you can see what the function does. It's pretty simple.
>>
>> Brad
>>
>> John Smith wrote:
>> > Hi All,
>> >
>> > Do we have any function to get no of days in a given month.
>> > Any builtin function available. if no, can you please tel me
>> > how I can do this.
>> >
>> > Thanks in advance for any help,
>> >
>> > John
>>
>>
>>


bede Posted on 2007-03-08 09:10:11.0Z
From: bede <bedenosp@msofico.be>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Getting No of days in a given month
Message-ID: <MPG.2059f162f70e26d498988f@forums.sybase.com>
References: <45eec4c9.6f3f.1681692777@sybase.com> <45eec752$1@forums-1-dub> <MPG.2058e96494dfb56e98988e@forums.sybase.com> <45eee5b0$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
Date: 8 Mar 2007 01:10:11 -0800
X-Trace: forums-1-dub 1173345011 194.7.38.226 (8 Mar 2007 01:10:11 -0800)
X-Original-Trace: 8 Mar 2007 01:10:11 -0800, uu194-7-38-226.unknown.uunet.be
Lines: 70
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9266
Article PK: 736424

Date ld_ref, ld_next
Integer li_month, li_daysInMonth, li_year

// Take month input & current year
li_month = Integer(sle_month.text)
li_year = Year(today())

// Set ref Date
ld_ref = Date(String(li_year) + "-" + String(li_month) + "-01")

// Increment month
If li_month > 11 Then
li_month=1
li_year++
Else
li_month++
End If

// Point to first day of this "next month"
ld_next = Date(String(li_year) + "-" + String(li_month) + "-01")

// Move 1 day back
li_daysInMonth = DaysAfter(ld_ref, ld_next)


Alternatively, use RelativeDate(ld_next, -1) to position on the last day of the previous
month, and use string functions to cut out the day part.

In article <45eee5b0$1@forums-1-dub>, NOCANSPAM_bruce.armstrong@teamsybase.com says...

>
> How exactly would that help someone determined the number of days in a
> particular month?
>
> (There is a way, but you're not providing enough information to point the
> person towards it).
>
> "bede" <bedenosp@msofico.be> wrote in message
> news:MPG.2058e96494dfb56e98988e@forums.sybase.com...
> > other way: DaysAfter (date1, date2)
> >
> >
> > In article <45eec752$1@forums-1-dub>, "Brad Wery[TeamSybase]"
> > <bradweryatagricoreunited.com>
> > says...
> >> Take a look at the pfc_n_cst_datetime object in the PFC library
> >> pfcapsrv.pbl. There's a function called of_lastdayofmonth. If you use
> >> this with the PowerScript Day function, you can get the number of days
> >> in a given month.
> >>
> >> If your app doesn't use PFC just get your hands on it some other way so
> >> you can see what the function does. It's pretty simple.
> >>
> >> Brad
> >>
> >> John Smith wrote:
> >> > Hi All,
> >> >
> >> > Do we have any function to get no of days in a given month.
> >> > Any builtin function available. if no, can you please tel me
> >> > how I can do this.
> >> >
> >> > Thanks in advance for any help,
> >> >
> >> > John
> >>
> >>
> >>
>
>
>