boris
Posts: 14
|
| Posted: 05/17/2006, 11:49 PM |
|
I'm trying to display just records that fall within a specific date range from today's date specified in a Search form ListBox but can't seem to get it to work.
The ListBox needs to contain a list the following list of values, within 7 days, within 30 days, within 180 days etc.
I want the user to be able to simply select one from the ListBox and show in the Grid records that match the criteria selected. For example. The user selects 7 Days and the Grid will show only records where the LastModified date field is within 7 days of today's date.
The Grid is based on a table with a LastModified field containing date values.
I'm sure it's a simple thing to achieve but i can't figure it out so If someone can please help me i would appreciate it? Thanks in advance.
|
 |
 |
Edd
Posts: 547
|
| Posted: 05/18/2006, 4:27 PM |
|
Boris,
Your results grid should be able to retrieve data based upon a date range of for example, from todays date to a parameter date.
The parameter date is passed by the search grids listbox. The way that you do this is populate the values of the listbox yourself and calculate the days forward from today. In the CCS help it tells you in the Examples & Techniques >> Customising the DataSource how to populate your own list box.
Ultimately you would populate this listbox with the values that you want example:
SearchGrid_BeforeShow()
Dim TodaysDate
Dim DatePlus7
Dim DatePlus30
Dim DatePlus180
TodaysDate = Date()
DatePlus7 = DateAdd("d",7,TodaysDate)
DatePlus30 = DateAdd("d",30,TodaysDate)
DatePlus180 = DateAdd("d",180,TodaysDate)
Set SearchGrid.ListBoxName.DataSource = CCCreateDataSource(dsListOfValues, Empty, _
Array(Array(Cstr(TodaysDate),Cstr(DatePlus7),Cstr(DatePlus30),Cstr(DatePlus180)),Array("Today","Last 7 Days","Last 30 Days","Last 180 Days")))
End Function
*** Note I used Cstr(TodaysDate) to change the date to a String you may need to format it to your regional date format.
I think you should get the idea.
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
|