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.

How to use SetFilter(string format) for date column

3 posts in Objects Last posting was on 2006-09-05 14:18:00.0Z
pc1 Posted on 2006-09-04 05:53:33.0Z
From: "pc1" <tieu@thrive.com.tw>
Newsgroups: sybase.public.powerbuilder.objects
Subject: How to use SetFilter(string format) for date column
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 222.253.199.249
X-Original-NNTP-Posting-Host: 222.253.199.249
Message-ID: <44fbbf5d@forums-1-dub>
Date: 3 Sep 2006 22:53:33 -0700
X-Trace: forums-1-dub 1157349213 222.253.199.249 (3 Sep 2006 22:53:33 -0700)
X-Original-Trace: 3 Sep 2006 22:53:33 -0700, 222.253.199.249
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9037
Article PK: 736231

Dear sir and madam,
Could you please help me to find what is wrong with below scripts
I am using PB V.10.1 and I want to filter dw_1 with date what will select
from treeview items object. But I always get notice "Expression types must
match"

/*----------------------------------------------------
If l_tvi.level = 2 Then
ll_child = FindItem(ChildTreeItem!,2)
tv_1.GetItem(ll_child, l_tvi)
tv_1.SetItem( ll_child, l_tvi )
ls_etd = string(l_tvi.Data)
Messagebox('',ls_etd)
dw_1.SetFilter("etd=" + trim(ls_etd))
dw_1.Filter()
End If
/*---------------------------------------------------
etd is column of dw_1 and datatype is date
l_tvi is treeviewitem object of tv_1 treeview control.

Looking forward to your early reply
Thank you so much for your kindly help!
Best regards
Tieu


Jason 'Bug' Fenter [TeamSybase] Posted on 2006-09-04 14:00:21.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com>
User-Agent: Thunderbird 1.5.0.5 (Windows/20060719)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: How to use SetFilter(string format) for date column
References: <44fbbf5d@forums-1-dub>
In-Reply-To: <44fbbf5d@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: adsl-75-38-14-182.dsl.rcsntx.sbcglobal.net
X-Original-NNTP-Posting-Host: adsl-75-38-14-182.dsl.rcsntx.sbcglobal.net
Message-ID: <44fc3175@forums-1-dub>
Date: 4 Sep 2006 07:00:21 -0700
X-Trace: forums-1-dub 1157378421 75.38.14.182 (4 Sep 2006 07:00:21 -0700)
X-Original-Trace: 4 Sep 2006 07:00:21 -0700, adsl-75-38-14-182.dsl.rcsntx.sbcglobal.net
Lines: 33
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9038
Article PK: 736232


pc1 wrote:
> Dear sir and madam,
> Could you please help me to find what is wrong with below scripts
> I am using PB V.10.1 and I want to filter dw_1 with date what will select
> from treeview items object. But I always get notice "Expression types must
> match"
>
> /*----------------------------------------------------
> If l_tvi.level = 2 Then
> ll_child = FindItem(ChildTreeItem!,2)
> tv_1.GetItem(ll_child, l_tvi)
> tv_1.SetItem( ll_child, l_tvi )
> ls_etd = string(l_tvi.Data)
> Messagebox('',ls_etd)
> dw_1.SetFilter("etd=" + trim(ls_etd))
> dw_1.Filter()
> End If
> /*---------------------------------------------------
> etd is column of dw_1 and datatype is date
> l_tvi is treeviewitem object of tv_1 treeview control.
>
> Looking forward to your early reply
> Thank you so much for your kindly help!
> Best regards
> Tieu
>
>

Hmm... should date literals be quoted in a dw expression? I have
honestly forgotten. You might try that, and if that doesn't work then
you can always force it by type-casting. Date() is a valid dw expression
function.


"Stephanie Young" <stephanie.youngN_O_S_P_A_M Posted on 2006-09-05 14:18:00.0Z
From: "Stephanie Young" <stephanie.youngN_O_S_P_A_M@standardregisterD_0_Tcom>
Newsgroups: sybase.public.powerbuilder.objects
References: <44fbbf5d@forums-1-dub>
Subject: Re: How to use SetFilter(string format) for date column
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Original-NNTP-Posting-Host: cyrano.standardregister.com
Message-ID: <44fd8457$1@forums-2-dub>
X-Original-Trace: 5 Sep 2006 07:06:15 -0700, cyrano.standardregister.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 5 Sep 2006 07:06:17 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 5 Sep 2006 07:18:00 -0700
X-Trace: forums-1-dub 1157465880 10.22.108.75 (5 Sep 2006 07:18:00 -0700)
X-Original-Trace: 5 Sep 2006 07:18:00 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9039
Article PK: 736235

take a look at this thread for an example of how to get the string formatted
and quoted correctly...

http://groups.google.com/group/powersoft.public.powerbuilder.powerscript/browse_thread/thread/1649429b7fb34d84/6a1a74ba57c3b15e?lnk=st&q=powerbuilder+setfilter+date&rnum=2#6a1a74ba57c3b15e

"pc1" <tieu@thrive.com.tw> wrote in message news:44fbbf5d@forums-1-dub...
> Dear sir and madam,
> Could you please help me to find what is wrong with below scripts
> I am using PB V.10.1 and I want to filter dw_1 with date what will select
> from treeview items object. But I always get notice "Expression types must
> match"
>
> /*----------------------------------------------------
> If l_tvi.level = 2 Then
> ll_child = FindItem(ChildTreeItem!,2)
> tv_1.GetItem(ll_child, l_tvi)
> tv_1.SetItem( ll_child, l_tvi )
> ls_etd = string(l_tvi.Data)
> Messagebox('',ls_etd)
> dw_1.SetFilter("etd=" + trim(ls_etd))
> dw_1.Filter()
> End If
> /*---------------------------------------------------
> etd is column of dw_1 and datatype is date
> l_tvi is treeviewitem object of tv_1 treeview control.
>
> Looking forward to your early reply
> Thank you so much for your kindly help!
> Best regards
> Tieu
>
>