Hi,

VFP 9.0 sp1, I'm trying to build a parameratized remote view against a SQL
2000 backend where the parameter is a date. The field on the SQL table is
of type datetime.

My view looks like this:
create view myview connection myconnection as ;
select slip_number, date_printed ;
from packing_slips ;
where date_printed >= ?prndate

My test code looks like this:
prndate = date()
use myview in 0
browse

This returns many records with various dates, not just todays dates. I
tried putting dtoc(date()) but that changed nothing. There must be a way to
do this, any suggestions?

The SQL table has slip_number of type varchar and date_printed as type
datetime. When I run the code form the query analyzer I simply enter the
date as '09-14-2007' and it converts automatically.

Thanks in advance,
Linn

Re: Remote view with date parameter? by Linn

Linn
Fri Sep 14 11:45:11 PDT 2007

Never mind, I just defined prndate as a Date datatype and that did the
trick.

Thanks anyways. Of course if someone see's a better way to do this I'm all
ears.

Thanks,
Linn

"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:eAAa34v9HHA.4476@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> VFP 9.0 sp1, I'm trying to build a parameratized remote view against a SQL
> 2000 backend where the parameter is a date. The field on the SQL table is
> of type datetime.
>
> My view looks like this:
> create view myview connection myconnection as ;
> select slip_number, date_printed ;
> from packing_slips ;
> where date_printed >= ?prndate
>
> My test code looks like this:
> prndate = date()
> use myview in 0
> browse
>
> This returns many records with various dates, not just todays dates. I
> tried putting dtoc(date()) but that changed nothing. There must be a way
> to do this, any suggestions?
>
> The SQL table has slip_number of type varchar and date_printed as type
> datetime. When I run the code form the query analyzer I simply enter the
> date as '09-14-2007' and it converts automatically.
>
> Thanks in advance,
> Linn
>
>
>