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

DTPicker

Status
Not open for further replies.

quakeunity77

IS-IT--Management
Jun 3, 2010
36
US
I am having problems with the time value of DTPicker. If I run the .APP I get one value and if I run the .EXE I get another value even though it was recompiled several times and "recompile all files" was checked.

I insert the time value of the DTPicker into a field of a table.
 
First, there are a number of DateTime Pickers, you need to clarify which one you are attempting to use.

Regardless, I will assume that you are using the Microsoft DTPicker object.

If you drop the M$ DTPicker onto your VFP Form, then you can get its value in a manner similar to the following:

dThisDate = TTOD(ThisForm.oleDtPicker.Object._Value)
or
cThisDateTime = TTOC(ThisForm.oleDtPicker.Object._Value)

I am not sure if that addresses your question or not.
If not, perhaps some clarification can assist us to assist you.

Good Luck,
JRB-Bldr


 
Thank you for your reply. I need to capture only the time in hour and minutes without the seconds.
 
If you want the Date + Time without the seconds, just get the entire DateTime character string with
cThisDateTime = TTOC(ThisForm.oleDtPicker.Object._Value)

and then remove the last characters including and after last colon (the last colon + 2 digit seconds + AM/PM).

Example:
tDateTimeSec = CTOT("10/01/2010")
?tDateTimeSec
cDateTimeSec = TTOC(tDateTimeSec)
?cDateTime
cDateTime = LEFT(cDateTime,AT(":",cDateTime,2)-1)
?cDateTime

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

Part and Inventory Search

Sponsor

Back
Top