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

Calendar Control.Value - Need to Convert the Format

Status
Not open for further replies.

tmishue

Programmer
Jun 26, 2001
35
US
Hello Out There,

Can anyone help me in converting a date such as
Mon Jan 15 00:00:00 EST 2001 to mm/dd/yyy. I have a field name StartDate with a datatype of datetime. I don't care about the time.

I am using Active X Calendar Control.value to get my date when the user click on it. Then I am querying my SQL database where StartDate = CalendarControl.Value . I can't get the query to work because the CalendarControl.Value is in the wrong format- Mon Jan 15 00:00:00 EST 2001

Any comments or suggestions would be greatly appreciated.


Thanks Much!

tammym
 
Format("mm/dd/yyy",CalendarControl.value)

This should work

Kostarsus

 
For Closure:
I got this answer from Rob (rjr9999) on one of the other forums. Thanks to all for taking the time to help me. It was greatly appreciated.

tmishue

The answer that worked for me:

rjr9999 (Programmer) Jul 3, 2001
I just tried this for fun, Hopefully it will help ;)

I used the Microsoft calendar control 8.0 and did this...

Dim tdyDate As String
tdyDate = Calendar1.Month & "/" & Calendar1.Day & "/" & Calendar1.Year
Label1.Caption = tdyDate

my label had the format of mm/dd/yyyy....let me know if this helps ;)

While you're waiting, i'll check with the other calender controls ;)

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top