StrataFrame Forum

BrowseDialog

http://forum.strataframe.net/Topic4851.aspx

By Larry Caylor - 11/29/2006

Don’t know if it has already been suggested but I’d like to see the BrowseDialog search criteria support a DatePicker control for date fields.

-Larry

By Larry Caylor - 11/29/2006

Now that's what I call service. Just think of an enhancement and it's there. Wink (Sorry to bother you guys, I didn't realize you had already added support for DatePicker)
By Larry Caylor - 11/29/2006

Now that I’ve had a chance to use DatePicker in the BrowseDialog it I’ve run into a problem. Any search for a date Equal to the date selected in DatePicker fails to return any records even though they exist in the data base.  I’m assuming the probable cause is that the time portion of the date/time field is not being handled correctly to allow a comparison of the dates only.

-Larry

By StrataFrame Team - 11/30/2006

Hrm... that's strange.  I'll check into that and see if there is something I can come up with.  However, if the dates in the database all have a time attached to them, then there might not be much I can do, but I will check.
By Larry Caylor - 12/1/2006

In SQL server any date stored as type DateTime or SmallDateTime is going to have a time component so you would need to eliminate it to search for a date equal to a specified date. One way to do that would be to use a select statement similar to the following

 

SELECT * FROM [Table] WHERE CONVERT(Char(10),[DateTimeColumn],101) =@SearchDate

 

If you were using a DateTimePicker to specify the search date, your search parameter would be something like

 

@SearchDate = String.Format(“{0:MM/dd/yyyy}”, DateTimePicker.value)

 

Another possibility I considered was adding a computed column (DateOnly) to my table. It would be defined as

 

CONVERT(Char(10),[DateTimeColumn],101)

 

I could then search on this in the BrowseDialog as text field by entering my search date in mm/dd/yyyy format. Some problems with this approach are that >, < searches wouldn’t work and  the Database Deployment Toolkit does not support computed fields which means I would have to modify the database after deploying it. I would also have to use the database and not DDT in ObjectMapper.

 

Regardless on whether or not you can fix this in the framework I suggest adding a “Between” for DateTime fields and displaying two DateTimePikcers for beginning and ending dates when selected  Most of the time, my users are looking for a specific date or a date that falls within a date range.

 

-Larry

 

 

By Trent L. Taylor - 12/1/2006

I will look into this.  Thanks.
By Larry Caylor - 12/1/2006

Another problem I found with the “computed column” approach is that even if it’s defined as a ReadOnly field in ObjectMapper the framework wants to update it on a Save and since you can’t insert or update a computed column you get an exception. I saw in another post that preventing the framework from trying to save all mapped fields would require a lot of work so this would likely be difficult to fix. When I was considering this approach I had assumed that marking a field as ReadOnly prevented the framework from trying to update the DB.

 

-Larry

 

By James H Hansen - 1/17/2007

Here's another vote for a "between" option for searches, but for other types as well, e.g.: any numeric type, character strings, etc.  It would look a lot better than having two lines in the search: "Distance between xxxx and xxxx"  It would also be nice if the BrowseDialog optimized this as appropriate for >=, <= or = when appropriate.
By Chan - 2/18/2007

I also need "between" range search feature. Has it been implemented? If not, any workaround?

Thank you

By StrataFrame Team - 2/19/2007

To implement a "between," you can add the search field twice... one with a "Greater Than" option and one with a "Less Than" option and turn off the Advanced Options for both of those fields.  Then, your users can just select the start and end values for the range.