Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7: Grid Filter By Date

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
Hello!

My grid isn't filtering. I am trying to filter my grid by date. What is happening is when the button is clicked the filter returns a "No Find" message.

The xdate variable is a date that is in the bdate field and bdate is a DATE field. If I use seek by itself it does find the xdate.

Any ideas?

Thanks!
CJ

Below is my code for my grid filter:

xdate = '09/02/2003'
ydate = '09/02/03'
SELECT book
SET ORDER TO WIZARD_1
SEEK xdate
IF FOUND()
SET FILTER TO book.bdate = xdate
GO TOP
SET MESSAGE TO "Top of the Book Grid"
ENDIF
 
For operations with dates use DTOS() function, for example:

INDEX book ON DTOS( bdate )
SEEK DTOS( xdate )
SET FILTER TO DTOS( bdate ) = DTOS( xdate )

Zhavic

---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top