Discussion:
Use date filters and parameters in views
(too old to reply)
Trimtrom
2004-08-28 14:07:43 UTC
Permalink
Hi,
i am a Foxpro 6.0 beginner and I am trying to use a database view. I
am trying to create a filter using a date field and am having enormous
problems.

I am trying to select records equal to a date in a view parameter
(?paradate is the name) and I find I cannot use the = sign in creating
the filter. An empty recordset is returned. The same using the <
sign. However, using the > sign, all the records in the table are
returned! I am obviously not treating the date field or the parameter
correctly, and I would be grateful if someone could show me how to
create a view filter based on this date field.

Many thanks,
Trimtrom
Cindy Winegarden
2004-08-28 17:06:56 UTC
Permalink
Hi Trimtrom,

Please right-click in the top portion of the View designer and choose View
SQL. Copy the code and post it here. Also, please post the code where you
Use the view and post the value of the date variable at that point.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
Post by Trimtrom
Hi,
i am a Foxpro 6.0 beginner and I am trying to use a database view. I
am trying to create a filter using a date field and am having enormous
problems.
I am trying to select records equal to a date in a view parameter
(?paradate is the name) and I find I cannot use the = sign in creating
the filter. An empty recordset is returned. The same using the <
sign. However, using the > sign, all the records in the table are
returned! I am obviously not treating the date field or the parameter
correctly, and I would be grateful if someone could show me how to
create a view filter based on this date field.
Many thanks,
Trimtrom
Karen
2004-08-30 13:41:32 UTC
Permalink
It sounds like your SQL date is actually a date/time field with actual
times, while the field you're comparing it to is defaulting to 12:00:00 AM.
This explains why you get nothing when you use < or = and return records
when you use >.
Post by Trimtrom
Hi,
i am a Foxpro 6.0 beginner and I am trying to use a database view. I
am trying to create a filter using a date field and am having enormous
problems.
I am trying to select records equal to a date in a view parameter
(?paradate is the name) and I find I cannot use the = sign in creating
the filter. An empty recordset is returned. The same using the <
sign. However, using the > sign, all the records in the table are
returned! I am obviously not treating the date field or the parameter
correctly, and I would be grateful if someone could show me how to
create a view filter based on this date field.
Many thanks,
Trimtrom
Loading...