Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Datawindow (Filter)

Datawindow (Filter)

hi to all PB programmers:

In datawindow, how can i filter all the data with a month of january and with the year 2001 (regardless of days specified) if the selected criteria for Month is January and for Year is 2001.Assuming the equivalent
value for January is 1.

the data that was retrieve in the datawindow are:


and the output that i want should be look like this:


tnx in advance...

RE: Datawindow (Filter)

Call an event with something like this:

String ls_filter

//supposing the column with the date is called "some_date"
//also assuming that some_date is of date or datetime type
ls_filter = "Year( some_date ) = 2001 AND Month( some_date ) = 1"

dw_test.SetFilter( ls_filter )
dw_test.Filter( )

RE: Datawindow (Filter)

tnx thekl0wn, the code absolutely works....

but, theres a problem when i'm trying to move the value's 2001 and 1 for january into a variable...

i've try this code but it doesn't work and it say's that "expresion is not valid"

the code looks like this:

String ls_filter
integer li_year,li_month

li_year = 2001
li_month = 1

ls_filter = "Year( some_date ) = li_year AND Month( some_date ) = li_month"

dw_test.SetFilter( ls_filter )
dw_test.Filter( )

can u pls help me to fix this problem...
tnx in advance....  

RE: Datawindow (Filter)


you cannot use a variable inside a string-constant. how could any compiler know how to interprete the code? the compiler (parser) cannot know if you want the content of a variable inside the string or if you want to have the characters inside the string.

ls_filter = "Year( some_date ) = " + string( li_year) + " AND Month( some_date ) = " + string( li_month)


Red Flag This Post

Please let us know here why the post below is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close