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

Converting a string to a datetime

Status
Not open for further replies.

morfeus

Programmer
May 22, 2001
9
CA
Dim s As String
s = "2000, 12, 1"
formula=CDateTime (s)

This one works just fine, return the datetime and time is naturally 00:00:00. But as the manuals say that the DateTime syntax is DateTime (YYYY, MM, DD, HH, MM, SS) or one can give a string that holds the DateTime in the same way.

Dim s As String
s = "2000, 12, 1, 12,10,0"
formula=CDateTime (s)

Well when I add the time the formula fails, saying :"BAd date-time format string" erm i have read the users giude a dozen time and i still belive that my syntax is correct but crystalreport fails or can someone state otherwise.
 
well found out about the us time syntax.... crystal reports manuals are nice that they speak of many ways to do this but that only one works actuall... great job by the author ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top