Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding
Message
From
17/02/2009 07:38:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/02/2009 00:16:53
Muthu Vel
Sty Company
India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Coding
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01382279
Message ID:
01382313
Views:
44
>I have designed "Report preview.scx" in that i have placed two text boxes namely 1.txtfromdate 2.txtdateto and one command button namely
>"cmdpreviw". I want to preview data between two dates and I have written code below
>
>local lcFrom, lcTo
>lcFrom = ThisForm.TxtFromdate.Value
>lcTo = ThisForm.TxtTdateto.Value
>select * from student;
> where date between CTOD(lcFrom )and CTOD(lcTo);
> order by date;
> into cursor Temp
>Report form "D:\List.frx" preview
>
>For first time I have entered dates in corresponding text boxes and click command button the preview will display, and i have clear the dates in two text boxes again I have entered different dates and click command button the preview will not display.
>
>how to correct my code? or
>Kindly advise me how to write code?
>
>thanking you

Similar to Bhavbhuti's suggestion, you can set the TextBox.Value to a blank date (without using a separate form property). ctod() is not very reliable - results may vary, depending on options such as SET DATE and SET CENTURY.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform