Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Table filter from date to date

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-03-2009, 05:18 PM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 38
Send a message via MSN to Standa
Awards Showcase
Beta Tester 
Total Awards: 1
Default Table filter from date to date

Hello,
I have table where one row of record contains date in format "yyyy-mm-dd". Is there some way how to make filter, for example from 7th month 2008th year to 3th month 2009th year?
__________________
BlackBerry 8900, Dell Streak, SE MBW-150
Reply With Quote
  #2 (permalink)  
Old 08-03-2009, 05:57 PM
maXim's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Sesto Fiorentino - Florence (Italy)
Posts: 224
Send a message via MSN to maXim Send a message via Skype™ to maXim
Awards Showcase
Beta Tester 
Total Awards: 1
Post

Hi Standa,

you're working with a database SQL-92 compatible o more?

The date field is a string?

If the date field is a string (not a date format) then:

Code:
<div align="left"><font face="Courier New"><font color="black"><font color="purple">q_Date_Start</font> = "<b>2008-07-01</b>"</font></font>
<font face=
"Courier New"><font color="black"><font color="purple">q_Date_End</font> = "<b>2009-03-30</b>"</font></font>
<font face=
"Courier New"><font color="black">xSQL = "<b>SELECT * FROM</b> <i><font color="sienna">[your table]</font></i><b> WHERE ((</b><i><font color="sienna">[date field]</font></i> <b>>= '</b>" & <font color="purple">q_Date_Start</font> & "<b>') AND (</b><i><font color="sienna">[date field]</font></i><b> <= '</b>" & <font color="purple">q_Date_End</font> & "<b>'))</b>"</font></font></div>

Last edited by maXim : 08-03-2009 at 06:10 PM.
Reply With Quote
  #3 (permalink)  
Old 08-03-2009, 06:53 PM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 38
Send a message via MSN to Standa
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi maXim,
there is little problem :-), I have used only simple table control, not sql. Because in the table will be not more than 250 records a year.
So is this filtering possible in the table control or have I use sql?
And yes, date is string format.
__________________
BlackBerry 8900, Dell Streak, SE MBW-150

Last edited by Standa : 08-03-2009 at 07:05 PM.
Reply With Quote
  #4 (permalink)  
Old 08-03-2009, 07:49 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hello Standa,

it is not possible to filter a "range" from a column which type is "cString".

A possible solution is to add a hidden table column (width = 0) of the type cNumber which contains the time or date information saved in ticks. This column could now be filtered easily for time ranges.


specci48
Reply With Quote
  #5 (permalink)  
Old 08-03-2009, 07:57 PM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 38
Send a message via MSN to Standa
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hey specci48 thank you!
This is what I already thought about - to make hidden column with cNumber value, but I did not know, how to make hidden column. Trick with width = 0 is smart, thank you :-).
__________________
BlackBerry 8900, Dell Streak, SE MBW-150
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date and Time Erel Tutorials 6 01-28-2010 11:01 PM
Query con date micro Italian Forum 4 11-11-2008 05:24 PM
working with date gjoisa Questions (Windows Mobile) 3 03-29-2008 09:40 AM
Table sort / date bob Questions (Windows Mobile) 1 11-16-2007 08:15 AM
filter for date manu Questions (Windows Mobile) 2 06-09-2007 01:13 PM


All times are GMT. The time now is 04:45 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0