desert
Posts: 24
|
| Posted: 02/07/2007, 2:11 AM |
|
We are trying to do a search string for a database based on dates.
The database insert is yyyy-mm-dd HH:nn:ss but what we want to do is to search
yyyy-mm . I have set up the search field dbformat is yyyy-mm-dd HH:nn:ss but format yyyy-mm but i get nothing back on the search. Do i need to go in Sql and reformat all the dates? Please help??
|
 |
 |
Dean Covey
|
| Posted: 02/07/2007, 5:17 PM |
|
You could create a field in your table to store the month and year or add the calculation to your recordset.
I am working on a payroll application where I created a table called periods. Then when I generate payroll records, the table is populated with the appropriate period ID. This way one I run a report, depending on a report I just include the period table in my recordset then search on the appropriate field. W2's for example, you would run by the year. Likewise, checks are ran by the check date. See my example here:
PerID Starting Ending CkDate MonthEnd QTR YR
3 12/18/06 12/24/06 12/29/06 12/31/06 4.00 2006
1 12/25/06 12/31/06 01/05/07 01/31/07 1.00 2007
5 01/01/07 01/07/07 01/12/07 01/31/07 1.00 2007
|
|
|
 |
Benjamin Krajmalnik
|
| Posted: 02/09/2007, 9:18 AM |
|
Use the BeforeBuildSelect event for the grid.
You can now retrieve the value from the search component using
CCGetParam("fieldname", DefaultValue).
Once you have this parameter, you can manipulate ti to your hearts content
and then manually code the where clause exactly how you want it.
I use this technique extensively to perorm some very complex searching where
the standard method using the where clause builder would not suit our needs.
"desert" <desert@forum.codecharge> wrote in message
news:645c9a5bf158dd@news.codecharge.com...
> We are trying to do a search string for a database based on dates.
> The database insert is yyyy-mm-dd HH:nn:ss but what we want to do is to
> search
> yyyy-mm . I have set up the search field dbformat is yyyy-mm-dd HH:nn:ss
> but
> format yyyy-mm but i get nothing back on the search. Do i need to go in
> Sql and
> reformat all the dates? Please help??
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|