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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATE()

Status
Not open for further replies.

ferdinandpagayatan

Programmer
Jul 14, 2015
7
PH
how to add date to another date in my textbox
ex:

07/15/2015 + 07/25/2015=?

and how to add datepicker only in my forms.
thanks and more power.
 
>n=ldStartDate - ldOtherDate + 1
Maybe just a misleading name, but start date typically is lower then the other date, if you subtract otherdate from startdate you get a negative number.
If you want a difference of dates either use ABS() or always subtract the lower/earlier/start date from the higher/later/end date.

Adding +1 is correct and can be seen from the extreme case both dates are equal you still have 8 hours on that single date, not 0.

In regard of the datepicker I second Mike. Also note what you tried and what problems you have with it. There are alternatives to the olecontrol, which doesn't work native on newer Windows versions, but you are allowed to redistribute and setup the ole control needed for the dtpicker and it works even on win8, though it looks outdated (no pun intended).

Bye, Olaf.
 
Since we have no idea what you want to know about the DatePicker Object you might want to begin with the following webpage and its downloadable example code:
How to use the DateTimePicker control in Visual FoxPro

Additionally you can do a Google search for: vfp datepicker object
Where you will find a number of references to look at.

One small piece of reference code that might be handy for you is how to get a Date from a DatePicker value on a VFP Form
Code:
Example:
[b]dFirstDate = TTOD(THISFORM.oleFirstDate._Value)[/b]  && One method of getting only the [u]Date[/u] portion from a DatePicker named:  oleFirstDate

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top